Proposal: Add &&& and *** to Data.Tuple

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Fri Sep 21 05:43:25 EDT 2007


Stefan O'Rear <stefanor at cox.net> writes:

> On Thu, Sep 20, 2007 at 03:23:05PM +0100, Jon Fairbairn wrote:
>> Another example would be mplus.  I happen to think that ++
>> is a good name for mplus, [...]
>
> The reason ++ and mplus is so similar is that they used to be the same;
> (++) *was* the MonadPlus class member. 

I haven't forgotten this (having been there for the old
version)! I'm somewhat surprised that I can find no record
of my objecting to the change for H98, but I wasn't on that
committee and was pretty ill at the time...

> Cale Gibbard explains this as {{{Quite a few people on the
> Haskell 98 committee had an irrational fear of
> polymorphism.}}}

It wasn't irrational (and not all of the committe agreed,
see
<http://www.cs.chalmers.se/~rjmh/Haskell/Messages/Decision.cgi?id=273>);
the motivation was didactic.  But the point of my proposal
here is that we can have it both ways: beginners importing
just List and using ++ get error messages about Lists, but
advanced programmers importing List and MonadPlus can use ++
without accidentally constraining their code to the wrong
Monad.

-- 
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk




More information about the Libraries mailing list