7 Aug
2002
7 Aug
'02
1:52 p.m.
Arthur Baars <arthurb@cs.uu.nl> writes:
f :: Eq a => a -> Bool f x = x==x || g True g y = y<=y || f True
According to the paper the inferred type of g should be: g::Ord a => a -> Bool
Hugs infers this type but GHC infers the following *ambiguous* type: g :: forall a. (Eq a) => Bool -> Bool
nhc98 infers the type g :: Bool -> Bool
When adding an explicit type signature for g, Hugs happily accepts the code, but GHC gives an error:
nhc98, like Hugs, accepts the explicit (more general) type signature: g :: Ord a => a -> Bool without complaint. Regards, Malcolm