Tuesday, 22 November 2011

Introduction to Functional Programming using Haskell

The course text for the Oxford University Functional Programming MSc module, the tone of the book is mathematical rather than aimed at the practicing coder. Silly though it may seem the typesetting bothers me. It comes from the maths rather than programming school, so I took a while to determine if I was looking at one or two equals signs, and you have to translate in your head from a maths multiplication sign to star, which is the asterisk that you would actually use in the code. The decision to use greek characters in the text, which cannot be actually typed into a Haskell program, is typical of the complete disregard for anyone who struggles to keep up. The unthinking elitism caused by this lack of empathy is very off-putting. The kindest thing one can say is that it is more readable than Richard Bird's other well known book "Introduction to Functional Programming" written with Philip Wadler. I cannot reproduce in HTML the definition given in the book for multiplication, which should have read
multiply :: Num a => a -> a -> a
multiply x = x * x
By contrast the typesetting and get it done attitude of the Haskell chapter in "Seven languages in seven weeks" is much more readable and conveys the main points of the language. After that I was able to return to "Introduction to Functional Programming using Haskell" with more success. I am beginning to fear that Haskell, in a similar way to XML, may suffer from not having been written by computer people. XML seems to have attracted odds and ends from Psychology, Archeology and Law, Haskell seems to come from mathematicians (and it would not surprise me to find physicists). My starting, received, prejudice is that ML may the the programmer's functional language.


Look again at