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

Henrik Nilsson nhn at Cs.Nott.AC.UK
Tue Oct 23 08:15:42 EDT 2007

Hi Josef,

Thanks for the thorough and thoughtful reply.
You do make a number of good points, and if people in general
think this is a good proposal, I don't want to be the one
killing it.

However, I have thought a bit more about what really bothers
me about the proposal, and I think it is this. You say:

 > The other side of the coin is what to name the functions. For this
 > proposal I chose the same names as their generalized counterparts. I
 > can see why that worries people although I don't share that feeling.
 > We have a module system whose purpose is (among other things) to
 > handle names. It does so rather well, consider for instance Data.Map
 > and Data.Set which I use extensively in my everyday programming. They
 > have a lot of function names in common and which also clashes with
 > Prelude names and other libraries. It's not a problem to have several
 > functions having the same name. It's actually a feature which lessens
 > the burden of remembering a ton of names and which shows that their
 > intended semantics is, if not equal, then strongly related.

Yes. If it truly were the case that we were talking about different
*functions* having the same name, I wouldn't be concerned. Data.Map
and Data.Set are good examples. But here we are talking about reusing
the name of a method, i.e. an already overloaded entity, as a function.
That does bother me, for some reason. I guess one level of overloading
too many for my taste. (Maybe my brain just cannot cope! ;-)
I'd be equally concerned if someone suggested using well-established
methods from, say, the Monad class for something else.

Part of it is also that the fact that an entity belongs to a class
notionally representing some mathematical structure implies a
"moral obligation" that instances of that entity should conform
to the structure, even if Haskell does not enforce this. Using
such a name for something else breaks or at least weakens that
conceptual link, which I think would be a pity.

Sorry that I don't have time to give a more in-depth reply at this



Henrik Nilsson
School of Computer Science and Information Technology
The University of Nottingham
nhn at

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

More information about the Libraries mailing list