Tuesday, 6 January 2009

Book: Real World Haskell (not much real world so far :)

I've just started to read Real World Haskell (the paper book). It seems like a nice book (except for a few irritating and confusing typos/mistakes at the start of the book).

However, I've read more than 100 pages so far, and still not a sign of any of the "real world" stuff promised by the title. I still don't know much or anything about IDE:s, how to compile the code, scripting, any practical details on how to structure your code into modules, or anything in that direction. So far, mostly (sometimes rather long-wined) discussions on specific (list) functions. One of the examples, end up in a conclusion that might be paraphrased as "by the way, don't use the function we've discussed the last few pages; in real world settings it doesn't work too well".

In the real world, you run into both needles and haystacks , occasionally, but that doesn't help making sense of

isInAny3 needle haystack = any (isInfixOf needle) haystack
And one more real world example of the kind zip3foobar "quux" and I may start losing interest... or just start screaming.

Well, the upcoming chapters have promising titles, so I guess I just have to keep reading. And I guess you have to start with the basics. Still, over 100 pages, and mostly foobars so far...

The book is available on-line.


Raoul Duke said...

well said.

Will said...

My experience(s) of Haskell has been that you have to put in the time with the basics, but you will be rewarded for that effort when you come to actually write code.

Take consolation from the fact that this book is a great deal more "Real World" than many of the others available (that I've waded through). The only other one that I liked was the "Haskell School of Expression" whose examples were all multimedia-based, so not so helpful when I wanted to know how to read a file, munge the data, then write it back out -- something which is covered by "Real World Haskell".
And I had to augment much of that book with online tutorials for various subjects, e.g. Monads and State, and even how consistently algebraic types could be used c.f. Java/C++/C types.

If "Real World Haskell" has been around when I started out, I think I would've understood the language and started coding with it far, far more quickly.