[Haskell-cafe] pleac, examples, etc
sjanssen at cse.unl.edu
Tue Nov 14 01:36:07 EST 2006
Please do not use the PLEAC Haskell cookbook for learning Haskell.
The author redefined many of the standard operators to produce code
that isn't standard Haskell.
Here are some choice snippets from the first chapter:
Now, we all know that the (.) operator is function composition,
right? Not in this example! The author has silently defined "(.) =
flip ($)" -- a sort of reverse function application.
> cut2fmt xs = xs.foldl aux (1,).snd.(GrabAll:).reverse
Ah yes, (^) is surely exponent here? Nope, it's some kind of unholy
combination of show and (++).
> s9 = "I have "^10+1^" guanacos."
More of the same:
> piece = s!![-8 .. -5]
Complaining aside, I do agree with you: we need more example-style
documentation. Rewriting the PLEAC cookbook might be a good start.
On Nov 13, 2006, at 11:57 PM, brad clawsie wrote:
> it would be great if some of the more informed posters here took a
> at filling in
> a neat site for cookbook-style problem solving
> from looking over haskell documentation for a few months now, i would
> say what is missing is one central cookbook-style document (want to
> query a database? want to parse xml? etc etc)
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe