[Haskell-cafe] Comments from OCaml Hacker Brian Hurt
jgoerzen at complete.org
Thu Jan 15 11:15:36 EST 2009
Lennart Augustsson wrote:
> I have replied on his blog, but I'll repeat the gist of it here.
> Why is there a fear of using existing terminology that is exact?
> Why do people want to invent new words when there are already existing
> ones with the exact meaning that you want?
> If I see Monoid I know what it is, if I didn't know I could just look
> on Wikipedia.
> If I see Appendable I can guess what it might be, but exactly what does it mean?
Picture someone that doesn't yet know Haskell.
If I see Appendable I can guess what it might be. If I see "monoid", I
have no clue whatsoever, because I've never heard of a monoid before.
Using existing terminology isn't helpful if the people using the
language have never heard of it.
Wikipedia's first sentence about monoids is:
In abstract algebra, a branch of mathematics, a monoid is an algebraic
structure with a single, associative binary operation and an identity
Which is *not* intuitive to someone that comes from a background in....
any other programming language.
A lot of communities have the "not invented here" disease -- they don't
like to touch things that other people have developed. We seem to have
the "not named here" disease -- we don't want to give things a sensible
name for a programming language that is actually useful.
Here's another, less egregious, example: isInfixOf. I would have called
that function "contains" or something. Plenty of other languages have
functions that do the same thing, and I can't think of one that names it
anything like "isInfixOf".
If you're learning Haskell, which communicates the idea more clearly:
I can immediately figure out what the first one means. With the second,
I could refer to the GHC documentation, which does not describe what a
Monoid does. Or read a wikipedia article about a branch of mathematics
and try to figure out how it applies to Haskell.
The GHC docs for something called Appendable could very easily state
that it's a monoid. (And the docs for Monoid ought to spell out what it
is in simple terms, not by linking to a 14-year-old paper.)
I guess the bottom line question is: who is Haskell for? Category
theorists, programmers, or both? I'd love it to be for both, but I've
got to admit that Brian has a point that it is trending to the first in
More information about the Haskell-Cafe