Functional programming

Not having a textbook to ease my introduction to Haskell, I have had to make do with what I could grab off net. It hasn’t been very enlightening and the material on monads couldn’t have been harder to digest. My years old copies of Byte Magazine have been great resources for all kinds of programming exotica including functional programming — but Haskell and Monads are too old for Byte.

There are many impediments to learning. Haskell is a purely functional programming language and it takes a day or two to get up to get up to speed with recursion. I’ve gone through this step many many times but after a few months of exclusively procedural programming, I forget again. The trick is that, in procedural programming you do, recursion is always of the primitive recusive kind where the depth of recusion is bounded by the data or some predefined restrictions. General recursion replaces the loop in functional programming and can be a slippery beast. Tail recursive calls are the direct analogue of looping. I know this… but it looks so different that this knowledge fades away. I need to be constantly reaquainted with tail recursive programming style in an otherwise loopy world.

Otherwise functional programming is a pretty comfortable environment for small programmes. You can ignore classes and monads and get useful work done. Once programmes get bigger is when the trouble starts.