modules & functional dependencies?

Simon Peyton-Jones simonpj@microsoft.com
Tue, 11 Dec 2001 01:37:06 -0800


Just for info, GHC currently disallows a class decl like

	class Foo a b =3D> Baz b where ...

on the grounds that 'a' is isn't mentioned in the 'Baz b'
part.  Arguably, if Foo has a FD b->a then it should be OK.
But currently it's rejected.

Simon

| -----Original Message-----
| From: Iavor S. Diatchki [mailto:diatchki@cse.ogi.edu]=20
| Sent: 10 December 2001 23:19
| To: hugs-bugs@haskell.org
| Subject: modules & functional dependencies?
|=20
|=20
| hi
|=20
| i seem to have stumbled upon a bug which somehow seems to be=20
| realted to=20
| the module system and functional dependencies.  attached are=20
| four files (sorry about that, but it seems to happen when the=20
| class and instance are in=20
| different modules), 2 files per example. =20
|=20
| when Bug1 is loaded, no error is reported (although it should=20
| have been). if i edit the file (say just add a blank line)=20
| using the :e feature, then an=20
| error is reported, but seems like the wrong error - it says=20
| ERROR "Bug1.hs":6 - Illegal type in class constraint while if=20
| i just move the class to the same module, i get the correct=20
| error ERROR "Bug1.hs":8 - Undefined type variable "t'" (GHC=20
| comes up with this same error)
|=20
| when Bug2 is loaded i get the error:
| INTERNAL ERROR: inheritFundeps - predicate failed to match=20
| it's own head!
|=20
| although these messages dont seem related it seems like their=20
| cause is=20
| common.  i am using the vesrion of hugs from the CVS from=20
| about 2 weeks ago (doesnt seem to have a number it just says YYMMDD)
|=20
| bye
| iavor
|=20
|=20