RE: Fundep/Existential Types in 5.03

I don't know how to make existentials "know" about functional dependencies. In the type system that GHC implements, your example fails, and I don't see any meaningful way to make it succeed. But maybe someone else does. Simon | -----Original Message----- | From: Ashley Yakeley [mailto:ashley@semantic.org] | Sent: 08 April 2002 10:30 | To: Simon Peyton-Jones; GHC List | Cc: Mark Shields | Subject: RE: Fundep/Existential Types in 5.03 | | | At 2002-04-08 02:15, Simon Peyton-Jones wrote: | | >Just leave out the existential in your defn of D! | >The (C a b) in the defn of f will do the job. | | I have another example, but this fails in 5.02.2: | | class C a b | a -> b | | data D a = forall b. (C a b) => MkD b | | f :: (C a b) => D a -> b | f (MkD b) = b | | Should this compile? It looks meaningful to me. | | | -- | Ashley Yakeley, Seattle WA | |
participants (1)
-
Simon Peyton-Jones