by YcombRegBroken · 13y ago · 0 comments
let loeb x = fmap ($ loeb x) x in
loeb [ (!!5), const 3, liftM2 (+) (!!0) (!!1), (*2) . (!!2), length, const 17]
(btw, I have no idea what the hell this does. Something to do with spreadsheets, apparently. I found it on http://www.haskell.org/haskellwiki/Blow_your_mind, which has enough cleverness to make me want to cry)I've seen cleaner and more readable code in production haskell, but this sort of thing happens enough that I'm very cautious.
With years of Haskell experience, I rarely encounter code that is hard for me to read. This is a good counter-example, and is not typical code.
I read 10 lines of Haskell code roughly as fast as I read 10 lines of Python code -- yet the 10 lines of Haskell code can pack much more useful information.
So Haskell is a great tool for more efficient communication between programmers, who can write shorter messages to each other to convey the same information.