MPTCs and functional dependencies
simonpj at microsoft.com
Thu Feb 2 06:36:34 EST 2006
I'm confident that it is premature to standardise functional
dependencies at this stage, very useful though they are. If you doubt
me, read the JFP journal submission that Martin Sulzmann and Peter
Stuckey and I have been working on.
Fundeps are very, very tricky.
My own view is that associated types are a more promising way forward at
the programming language level. They are a little less expressive than
fundeps, I think, but a whole lot less tricky. But we don't have an
implementation of them yet, so we can hardly standardise them!
Multi-parameter type classes, yes. Functional dependencies, no.
| -----Original Message-----
| From: haskell-prime-bounces at haskell.org
[mailto:haskell-prime-bounces at haskell.org] On Behalf Of
| Ross Paterson
| Sent: 02 February 2006 11:25
| To: haskell-prime at haskell.org
| Subject: MPTCs and functional dependencies
| On Thu, Feb 02, 2006 at 11:38:07AM +0100, John Hughes wrote:
| > The problem with Haskell 98 is that it *lacks* features which
| > have become absolutely essential to Haskell programmers today. Those
| > features are what really *need* discussion and energy spent on them.
| > [...]
| > Multi-parameter classes with functional dependencies
| > - used everywhere... for example in monad transformers... so
| > *must* be included this time
| > - omitted from Haskell 98 because "the right design" wasn't
| > - it's still unclear! Functional dependencies *in some form*
| > are essential, but associated types and datatypes look nicer
| > in many ways!
| > - is it too late, in practice, to replace fundeps by something
| > else? How will we know? If we are to standardize on
| > types instead, we need a major effort to *make sure* all
| > important applications of fundeps can be represented. How
| > we organize that?
| I agree that MPTCs are much less useful (though not completely
| without something like FDs or associated types. But the specification
| of FDs is far from clear: the system described in Mark's paper is
| a bit weaker than what is implemented by GHC and (more shakily) by
| It seems that associated types aren't ready yet, but I don't think FDs
| are either, accustomed as people are to them.
| I have another worry about MPTCs. They require require relaxations on
| the form of instances (FlexibleInstances on the wiki), which in turn
| require relaxations on contexts and thus deferred context reduction
| FlexibleContexts). The result is that missing instances get reported
| later than they do now. MPTCs are very useful and probably necessary,
| but there is a cost.
| Haskell-prime mailing list
| Haskell-prime at haskell.org
More information about the Haskell-prime