Maybe Haskell …
14 Sep 2013After reading Learn You a Haskell on and off over the past fortnight and watching a couple of Erik Meijer’s Functional Programming Fundamentals, I finally got around to installing the Haskell platform and firing up GHCi.
After a couple of hours of implementing the simple functions scattered throughout LYAH, I was up to implementing quick sort. Given the number of times I’ve seen this example, I’m not going to reproduce it here, but it’s pretty amazing 1.
One of the main things I noticed was that after two hours of writing code in a language I’d never used, I’d produced zero run time errors. There were plenty of compile errors, but that’s to be expected – especially given I was using an editor that was inserting tabs in a language with significant white space (which, by the way, makes for fun times when unfamiliar with Haskell compiler errors). I know what kind of error I would prefer to deal with.
So far I’m liking Haskell, and I think it’s a huge shame that there is only one functional programming course at my university (COMP1024), which isn’t available to most dual degree students.
Edit: COMP1024 hasn’t been offered since 2010.
1. I know this isn’t ‘true’, in-place, high performance quick sort, but in how many other languages can you write a readable, generic sorting algorithm in 6 lines of code?