[Haskell-cafe] Line noise

Andrew Coppin andrewcoppin at btinternet.com
Sun Sep 21 14:14:58 EDT 2008


I hang out on another forum that is populated by various kinds of 
computer geeks. There's a fair few programmers in there, as well as 
nerds of every degree. And yet, every time I post anything written in 
Haskell, everybody complains that it "looks like line noise".

What do "normal" programmers find so puzzling about Haskell? You might 
guess some of the following:
- High-order functions.
- Lambda functions.
- Algebraic data types.
- Lazy evaluation.
- Recursion.
- Monads.

Actually, none of these things were mentioned. The things people have 
*actually* complained to me about are:
- Haskell expressions are difficult to parse.
- Several standard library elements have unhelpful names such as "elem", 
"Eq" and "fst". (My favourite has to be "Ix". I mean, WTH?)
- Several standard library functions have names which clash badly with 
the usual meanings of those names - e.g., "break", "return", "id".
- Variable names such as "x" and "f" aren't fabulously helpful to lost 
programmers trying to find their way.

If you take a "typical" lump of C or Java code, there's so much 
redundancy and noise in it that you can *usually* figure out vaguely 
what's going on, even if it doesn't completely make sense. When 
presented with a typical Haskell fragment... uh... well, good luck with 
that. Let's take Haskell's most celebrated example:

  qsort [] = []
  qsort (x:xs) = qsort (filter (x <) xs) ++ [x] ++ qsort (filter (x >=) xs)

To a novice, it's not actually real clear what the arguments to qsort 
are. You and I know that function application binds much more tightly 
than (++), but a novice isn't going to know that. You might also not 
immediately realise that "xs" is also an argument to filter, not just (x 
<) or whatever. The people I spoke to also seemed pretty confused about 
the usage of (.) and ($), even after I explained it a few times. Several 
people also voiced being puzzled about Haskell's layout rules.

I'm not sure what we *do* with all this data, but I found it interesting 
so I thought I'd share. ;-) I've spent the last few years trying to 
convert a few people to The Haskell Way(tm), but so far I haven't 
succeeded in the slightest. I just get yelled at for pointing white 
noise. Heh. Oh well!



More information about the Haskell-Cafe mailing list