[Haskell] Newbie: fix

2007-05-02 Thread phiroc
Hello, could someone please explain why fix is necessary here: fix (\f l - if null l then [] else let (s,e) = break (==' ') l in s:f (drop 1 e)) Source: http://www.haskell.org/haskellwiki/Blow_your_mind Thanks. phiroc ---BeginMessage--- Hello, could someone please explain why fix

[Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread phiroc
doing IO? Aren't Haskell's advantages outweighed by its complexity (Monads, etc.) and rigidity? Last but not least, I would like to learn from those among you who are former PERL developers, why you switched to Haskell. Many thanks. phiroc ___ Haskell

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread phiroc
If this is interesting then please enlighten a poor, ignorant PERL hacker. Quoting Johannes Waldmann [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: [...] semi-functional programming languages such as Perl [...] now this is an interesting view ...

[Haskell-cafe] pythags

2007-02-12 Thread phiroc
, whenever you load that function definition into Hugs or GHCi, you get a message saying that guard is an undefined variable. Does anyone know why? Thanks. phiroc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

[Haskell-cafe] Newbie: generating a truth table

2007-02-06 Thread phiroc
printStr(Calling and True False returns ) and True False printStr(Calling and False True returns ) and False True printStr(Calling and False False returns ) and False False Many thanks. Best regards, phiroc

Re: [Haskell-cafe] Newbie: generating a truth table

2007-02-06 Thread phiroc
of calling and2 True False ... Thanks. phiroc Quoting Ketil Malde [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: I would like to create a Haskell function that generates a truth table, for all Boolean values, say, using the following and function : and :: Bool - Bool - Bool and a b = a b

Re: [Haskell-cafe] Newbie: generating a truth table

2007-02-06 Thread phiroc
Hello, how would you convert Boolean triples to strings, in the IO function? printStrings :: (Bool,Bool,Bool) - IO () phiroc Quoting Lennart Augustsson [EMAIL PROTECTED]: It would be better to produce a triple (as was suggested) loop = [(x, y, xy) | x - [True, False], y - [True, False

[Haskell-cafe] Partial application

2007-01-18 Thread phiroc
Hello, could someone please give me an example of the partial application of the following curried function: add' :: Int - Int - Int add' a b = a + b Normally, add' 1 should work, but it doesn't. Many thanks. phiroc ___ Haskell-Cafe mailing list

[Haskell-cafe] Currying

2007-01-18 Thread phiroc
Hello, what is so great about currying? What are its uses, apart from letting one define functions with less parentheses? Many thanks. Phiroc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe