TechBookReport logo

Keywords: Haskell, functional programming, computer languages

Title: Learn You a Haskell for Great Good!

Author: Miran Lipovaca

Publisher: No Starch Press

ISBN: 978-1593272838

Media: Book

Level: Introductory Haskell, but some programming knowledge useful

Verdict: A solid introduction


Functional programming languages have long been something of a niche interest. It's a style of programming that is popular in academic settings, where it's used as a teaching tool in many computer science classes, and as an area of active research. The impact has been less significant in the wider world, where imperative, object oriented languages - such as C++, Java, C#, Python etc - have been more popular, along with languages such as C, PHP, JavaScript and so on. However, there are a number of functional programming languages that are garnering much more interest, including Clojure, Scala and Haskell. Of these, Haskell is the 'purest' functional language, and therefore requires more of a paradigm shift from those of us used to non-functional languages.

Miran Lipovaca's 'Learn You a Haskell for Great Good!' promises to A Beginner's Guide to Haskell. The question is how well does it succeed?

The first thing to note is that the book really assumes that you're a beginner when it comes to Haskell, not that you're a beginning programmer. While there may be some value in starting with Haskell as a first language, the chances are that the true beginner is likely to get more out of something more mainstream. Aside from anything else, the emphasis on the command line and the creation of snippets of code (computing the Fibonacci series using recursion, for example), is unlikely to help someone who really doesn't have much of a clue as to what program is, let alone the relative merits of looping versus recursion.

The book starts gently, and the emphasis is firmly on the hands on approach using the GHCi interpreter - which is the de facto standard Haskell implementation. Language features are introduced in a fairly logical manner, and tested using one of two line function that can be keyed in to the command line and executed immediately. Trying to read the book without following along yourself is a less than satisfying experience. You quickly get used to the rather terse syntax, but even then you'll find yourself flicking backwards every so often. This isn't a bad thing, as it helps consolidate what you learn.

As with the title, there's a certain quirkiness on display throughout the book, from the cartoon to some of the text. If the intention is to bring out the playfulness of the language it sort of works, though at times the significance of what you've just covered isn't immediately clear. And, just as the language lends itself to very terse (and often almost unreadable) functions, so the book manages to cover an awful lot of material in its pages.

What's clear is that there are features of Haskell that are really interesting - and that means more than just lambda functions. The idea that you can have infinite data sets is fairly surprising for those of us used to other languages. As is the idea of programming without 'state'. It takes some getting used - though if you've ever worked with XSL or used streams it's more familiar.

A positive of the book is that the concepts are clearly explained, not just the mechanics. And this is useful even if, ultimately, you decide not to program in Haskell. Having learned from this book you'll be in more of a position to write functional-like programs even in non-functional languages. Why should you be at all interested in this? Because with cloud applications program state is precisely what you don't have - or at least, not in the same way as when writing non-cloud applications.

So, whether you're interested in a little intellectual exercise, or whether you want to learn Haskell for real work, is this the place to go to? And it is. You'll have to do some work to get the most out of this book, but it is a very solid, competent and useful resource.

Hit the 'back' key in your browser to return to subject index page

Return to home page

Contents © TechBookReport 2011. Published October 19 2011