Method contexts
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Sun Jan 28 09:41:01 EST 2001
Thu, 25 Jan 2001 09:55:08 -0800, Simon Peyton-Jones <simonpj at microsoft.com> pisze:
> The HEAD, which will become GHCi 5.0, does not have functional
> dependencies, and I think they work properly
You meant that it does have them :-)
Indeed it seems to finally work with my collection experiments which
heavily use fundeps. It used to work with Hugs only. Thanks!
Could ghc relax the requirement we talked about some time ago, that
a method context must constrain a type variable which is quantified
there? For example:
------------------------------------------------------------------------
class Member c k where
member :: Eq k => c -> k -> Bool
class Member c a => Seq c a
instance Member [a] a where
member s x = x `elem` s
instance Seq [a] a
------------------------------------------------------------------------
I see no reason to disallow this, it is needed to express requirements
about sequences specified above, and hugs -98 accepts this.
BTW, ghc prints the type in an unusual way:
The constraint `Eq k' does not mention any of the universally quantified type variables
in the type `{Eq k} -> c -> k -> Bool'
--
__("< Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTÊPCZA
QRCZAK
More information about the Glasgow-haskell-bugs
mailing list