# seven languages in seven weeks: haskell

some thoughts on haskell book-club reading published:i don't have any first impressions with haskell now as this was my 2nd programming language i learned in university, after c, however, i remember that at times it did feel like magic.

there are parts that are almost trivial to program in haskell, but difficult in an imperative language and vice versa. in the very first functional programming lecture we had we were shown quicksort written in haskell.

- haskell programs are concise and you feel like you're programming at a higher level of abstraction, especially when leaning towards point-free style
- higher-order functions, currying, generic functions
- no loops, just recursion
- lazy evaluation

```
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) = quicksort smaller ++ [x] ++ quicksort larger
where
smaller = [a | a <- xs, a <= x]
larger = [a | a <- xs, a > x]
```

the book has a section that tries to explain monads, but i'm not sure it makes anything clearer. i didn't find it a particularly good explanation. there are loads of explanations on monads out there and everyone who thinks they understand monads feels the need to write up their own. functors and applicatives and monads are just an interface. i think functors and monads for people who have read too many "tutorials" gives a much more intuitive explanation.