Now that's self-documenting
Another great moment from the daily wtf about the seemingly easy to understand language Haskell. (emphasis mine)
Functional programs are often easier to understand. You should be able to understand the program without any previous knowledge of either Haskell or quicksort. The same certainly cannot be said of the C program. It takes quite a while to understand, and even when you do understand it, it is extremely easy to make a small slip and end up with an incorrect program. Here is a detailed explanation of the Haskell quicksort:
qsort [] = []
qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x
where
elts_lt_x = [y | y <- xs, y < x]
elts_greq_x = [y | y <- xs, y >= x]
If you are still unconvinced that Haskell is easy to understand, check out their code comparison with C. You now know the programmers' obfuscation motto: If it's frickin' hard to write, it should be frickin' hard to read!
Tags: programming, haskell, obfuscation, code, wtf