[Haskell-beginners] How to think in Haskell (Jun HU)

Sean Charles sean at objitsu.com
Fri Dec 17 15:44:09 CET 2010


I learned Smalltalk in 1999, then I found LISP because Alan Kay said it
was the most awesome language ever invented. That got me hooked into
using s-expressions for everything! 

Then I found Erlang and that was just brilliant, although I still missed
the s-expression format of LISP.

Then, about seven months ago I decided to try Haskell, I bought the Real
World Haskell book and I've been trying to get better every day I can.

I've been a software develoepr for aobut twenty-six years, from assembly
language on chips and DEC/VAX right through to today and without doubt
Haskell has been my single most frustrating learning experience ever.

And that my friends is a compliment to Haskell!  :)

I am *not* a mathematician, I did 'A'-level maths and physics and
computers back when Clive Sinclair was a force to be reckoned with.
To be told I have to read a big list of stuff with titles that would
make people think I was speaking in tongues doesn't cut it for me. For
my day job I *have* to cut PHP/Drupal, so I applied learning Haskell and
made myself some tools that generate Drupal code! 

Make it relevant to what you do everyday, that way it will carry more
meaning for you, why spend hours head-scratching over some fancy pants
monadic kung-fu lesson when you can as easily learn to read a file and
process each line, do something with it and then create a new file.

First rule of optimisation: Don't do it. It was how I felt learning LISP
too, there are so many functions to do things, which is the 'right' one?
Make it work first then you can step back and say, "Can I do this more
succinctly using more advanced language features?"

Don't try to learn it all at once, it's depressing! I know!


BIG HELP: The single biggest thing that helped me was to download the
PDF slide-notes and watch both parts of Simon Peyton Jones talks, all
available here:
http://notes-on-haskell.blogspot.com/2007/08/more-spj.html

It was when I realises that, unlike C++ for example, where there is an
implicit 'this' pointer stuffed in the stack, in Haskell programs there
is an implicit pointer to the type information being passed around which
made lots of things click for me like "How does it know?" LOL

Haskell is the classic elephant sandwich; a formidable task, but
everytime I understand something new it feels great!

Best of luck!
:)
Sean Charles






More information about the Beginners mailing list