Tuesday 22 December 2009

The Joy of Haskell

About a year ago, I spent the best part of a day playing with Haskell, which was long enough to intrigue me as to its possibilities but not long enough to develop any real understanding of the language. Since then, my functional programming urges have lain dormant - until last week, when I decided to dust off my copy of Real World Haskell and spend a bit longer with the language.

So far, it has been an enjoyable experience, albeit a demanding one at times. I'm very impressed by the elegance and expressive power of Haskell. I've just been reading about currying and function composition and can sense a broadening of my mental horizons somewhat akin to that which I felt on first encountering the UNIX tools philosophy. It was a revelation then to realise just how much more flexible UNIX could be than rival operating systems, thanks to the idea of having many small, simple utilities, controlled via command line flags and connected via pipes. I'm beginning to feel that Haskell offers analogous benefits, compared with the other languages that I've been using for so many years.

That said, I'm encountering the odd thing that makes me cringe. A few of the functions seem to have rather ugly names - putStrLn being a prime example. But I guess I can learn to live with that.

Real World Haskell seems to be pretty good. My only significant quibble so far concerns the exercises, which could do a better job of reinforcing and building on the concepts introduced in the text.

It's too early to say whether my programming habits will be irrevocably changed by all this; I suppose it depends to a large extent on how much more time I'm prepared to spend on Haskell. I sense I'm on the verge of 'getting it', so who knows?...

No comments:

Post a Comment