Fundep/Existential Types in 5.03

Simon Peyton-Jones simonpj@microsoft.com
Mon, 8 Apr 2002 04:14:49 -0700


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]=20
| Sent: 08 April 2002 10:30
| To: Simon Peyton-Jones; GHC List
| Cc: Mark Shields
| Subject: RE: Fundep/Existential Types in 5.03
|=20
|=20
| At 2002-04-08 02:15, Simon Peyton-Jones wrote:
|=20
| >Just leave out the existential in your defn of D!
| >The (C a b) in the defn of f will do the job.
|=20
| I have another example, but this fails in 5.02.2:
|=20
|   class C a b | a -> b
|=20
|   data D a =3D forall b. (C a b) =3D> MkD b
|=20
|   f :: (C a b) =3D> D a -> b
|   f (MkD b) =3D b
|=20
| Should this compile? It looks meaningful to me.
|=20
|=20
| --=20
| Ashley Yakeley, Seattle WA
|=20
|=20