Hugs -98 (Feb 2001) rejects the following program (which should be well-typed)

> foo :: ((?x :: Int) => b) -> Int -> b
> foo s z = s with ?x = z

with the message

ERROR Bug.hs:2 - Inferred type is not general enough
*** Expression    : foo
*** Expected type : ((?x :: Int) => a) -> Int -> a
*** Inferred type : ((?x :: Int) => a) -> Int -> Int

It seems to unify the type of the implicit parameter with the type of
the result.

GHC accepts this program (but generates wrong code).

John Hughes

_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs

Reply via email to