relaxed instance rules spec (was: the MPTC Dilemma
ross at soi.city.ac.uk
Thu Mar 2 09:17:36 EST 2006
On Thu, Mar 02, 2006 at 12:03:59PM -0000, Claus Reinke wrote:
> The way I interpret FDs implies that they introduce a systematic space
> leak into the inference process: if any stage in the inference uses *any*
> constraint with a class which is subject to an FD, that results in an
> additional bit of information about that class' FD. and we *cannot*
> throw that bit of information away unless we know that we will
> never need to refer to it in the remainder of the inference chain.
But with the current system you can throw it away, because it's implied
by the FDs on the classes in the context. A system where that was
not the case would be significantly more complex than the current FDs,
which I think disqualifies it for Haskell'.
The original FDs have the property that the set of valid ground predicates
is determined by the instance declarations alone, and is unaffected by
the addition of FDs. The FDs merely imply that some predicates can never
be valid, even if other instances are added later, and thus justify type
improvement and reduced ambiguity. I think this separation makes them
much easier to think about, and we should be cautious about losing it.
More information about the Haskell-prime