Learning Haskell

Chris Okasaki – Purely Functional Data Structures
Simon Thompson – Haskell: The Craft of Functional Programming
Bryan O’Sullivan, Don Stewart, and John Goerzen – Real World Haskell

My team at UTS, the eResearch Support Group, has just finished off two major projects, for which I wrote a lot of integration code in Perl and hacked around a lot more than I cared to in Velocity, a horribly ugly template library for Java which is now at the top of my least-favourite-technologies list.

Despite the fact that my job involves less coding than it used to, and that this proportion is likely to drop further, I needed to clean all the glue out of my brain, so I’ve returned to teaching myself Haskell. The last time I attempted this was about five or six years ago: since then, an open-source ecosystem seems to have developed around what was once a very academic language. There are web frameworks and package repositories and things which aren’t really possible in other languages, like a search engine by type signature.

The best way to learn a language is to do something useful with it, and I have a work project for the end of next year in mind: whether Haskell is the right choice or not is something I haven’t quite decided yet.

I read the first two of the three books a couple of months ago: The Craft of Functional Programming was a good way to remind myself of the basics, but I didn’t have the time or energy to work through the exercises, so it didn’t stick. I looked up Purely Functional Data Structures because a friend who is much brighter than I  mentioned it; it’s not so much about Haskell per se, as it is a demonstration that the kind of reasoning which makes for efficient data processing in imperative languages can be applied to functional ones. Not having a background in computer science, I think I understood about forty percent of it, but it left me with the feeling that those who deeply understand such things will have taken care of the details and written great libraries for me to use.

I’m currently reading Real World Haskell properly and doing all of the exercises in spare moments and it’s a lot of fun. I think I’ve even started to understand, or remember, what monads are. (In a side-effect-free programming environment, state – or a sequence of imperative instructions, which is really just a particular kind of state – can be modelled as a sequence of nested evaluations.)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s