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