overlapping instances and functional dependencies
8 Aug
2003
8 Aug
'03
11:32 p.m.
Hello, I have this code: class C a b c | a b -> c where f :: a -> b -> c instance C a b c => C a (x,y,b) c where f a (_,_,b) = f a b instance C a (a,c,b) c where f _ (_,c,_) = c ghci -fglasgow-exts -fallow-overlapping-instances compiles it without complaint but hugs -98 +o says: ERROR "ClassProblem.hs":7 - Instances are not consistent with dependencies *** This instance : C a (a,b,c) b *** Conflicts with : C a (b,c,d) e *** For class : C a b c *** Under dependency : a b -> c Can anyone tell me what the reason for this is and, maybe, how to avoid these problems with Hugs? Wolfgang
8420
Age (days ago)
8421
Last active (days ago)
1 comments
2 participants
participants (2)
-
Andrew J Bromage -
Wolfgang Jeltsch