MPTCs and functional dependencies

Henrik Nilsson nhn at Cs.Nott.AC.UK
Thu Feb 2 08:28:37 EST 2006


Dear all,

Simon PJ wrote:

 > Multi-parameter type classes, yes.  Functional dependencies, no.

My experience is that even with very simple applications of MPTCs,
I often end up needing functional dependencies to make things work.

Thus, if my hunch is right, and other people have a similar experience,
my fear would be that omitting FDs or something similar would result
in a Haskell' standard that ends up being out of date even before it is
finalised, in that a large number of real world applications and
libraries would fail to be standard compliant and could not easily
be adapted to be.

I think that would be very unfortunate, even though I do agree that
the Haskell' effort should strive to be as conservative as possible.

Might it be possible to at least allow some simple forms of FDs
that would cover the most common cases, e.g. like what's described
in Mark's original paper?

I personally would not be too worried about adopting a possibly
non "future-proof" solution in this respect, as I would expect
that the amount of code that would have to be change would be
fairly small if some scheme like associated types later are adopted
as a replacement.

What would worry me is the lack of ANY functionality like FDs,
as having to work without them means that code often would have
to be too type specific, which in the end might result in lots
of code duplication. Refactoring such code later would seem to
be much more work (even if it might not be strictly necessary to
do so, as the code would continue to work).

But maybe other people have a somewhat difference experience,
and feel that this is less of an issue than I believe it is?

All the best,

/Henrik

-- 
Henrik Nilsson
School of Computer Science and Information Technology
The University of Nottingham
nhn at cs.nott.ac.uk


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 Haskell-prime mailing list