# Anomalous Class Fundep Inference

**Ashley Yakeley
**
ashley@semantic.org

*Sun, 8 Apr 2001 03:07:11 -0700*

In Hugs 98 Feb2001 (as hugs -98), this piece of code gives an error:
--
class X a b | a -> b where x :: a;
class (X a b) => Y a b | a -> b where y :: a;
instance (X a b) => Y a b where y = x;
instance (Num a) => X a a where x = 0; -- line A
--instance X Int Int where x = 0; -- line B
--
Reading file "Bug.hs":
Type checking
ERROR Bug.hs:3 - Inferred type is not general enough
*** Expression : y
*** Expected type : Y a b => a
*** Inferred type : Y a a => a
However, if I replace line A with line B, it compiles. Is this correct,
or is it a bug in Hugs?
Sooner or later I should install GHC for Mac OS X...
--
Ashley Yakeley, Seattle WA