Fundeps discrepancy

Ken Shan ken at digitas.harvard.edu
Thu Nov 27 00:20:59 EST 2003


Hello again,

Please pardon another question on functional dependencies.  GHC and Hugs
behave differently on the following code:

    class Tr tr a b | tr -> a b where f :: tr -> a -> b
    class (Tr m a b, Tr n b c) => TrPair m n a c

The type variable b on the second line does not appear in the head,
but is determined by m and n in the head via the functional dependency
declared for Tr.  Hugs accepts this code, while GHC doesn't.  The
original fundeps paper (Mark Jones, ESOP 2000) seems silent on this
point.

Taking a step back, is there a formal description of type inference for
functional dependencies in Haskell type classes?  A set of typing rules,
or something written along the lines of John Peterson and Mark Jones's
"Implementing type classes" (PLDI 1993) or Mark Jones's "Typing Haskell
in Haskell", would be wonderful to have.

	Ken

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
Tax the rich!
new journal Physical Biology: http://physbio.iop.org/
What if All Chemists Went on Strike? (science fiction):
http://www.iupac.org/publications/ci/2003/2506/iw3_letters.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://haskell.org/pipermail/haskell/attachments/20031127/8bd89d60/attachment.bin


More information about the Haskell mailing list