Learning Haskell

For some time I was looking at a functional language to learn, as it is another approach on solving the problems we encounter every day. I started to look at Erlang, as it is used for CouchDB. Still, it is more network oriented, and I wanted something more general. I also thought of Lisp and Scheme. Then I stumbled upon an article from Simon Peyton-Jones, “On the importance of being the right size: the challenge of conducting realistic experiments”. I then took the firm decision of learning a functional language, and that this language shall be Haskell.

My motivations are partly summarized in Why Haskell matters. First, functional programming opens a different approach on programming. This will give me an other look on the way to program with imperative languages. Second, all the advertisement on side-effect free programs is interesting, as I mentioned in a previous post. Now every function I write in Fortran will be at least pure. The laziness of Haskell didn’t strike me at the first time, it was not a strong point to convince me. I see now why they emphasize on it. The same with the strong typing, by the way. One thing which seduced me is the elegance of functional programs, and the one in Haskell more particularly. I like the quicksort algorithm they describe because it focuses more on the algorithm than in its implementation itself. I have read that several times: “write what you want to do, and not how you want to do it”. This is really enjoyable.

But one of the most important point is the community. I felt at home there, with people contributing, helping, and putting efforts on writing elegant and efficient programs. I will find many places, links and people to learn more on computer science, functional programming in general, with a hogh level for a newbie as I am in this field.

As I was looking for a book to learn it, I found Real World Haskell, which is free online. I then decided to buy a paper copy of the book, as I prefer to read on paper, and to contribute to the work of the authors. 700 pages which will keep me busy for a while. And this is a good thing: I did not want a sparse book that you can read only once (cf. PragProg and co.).

So, here I am, starting from nearly scratch, as I have to forget about many habits I have developped with imperative languages. And this is good. Dear, I should have done that long time ago.