Alejandro Russo wrote:
I try the follow line in hugs (mode 98 enable)
Prelude> :t (let f = \x -> x == x in ( f 'a', f 123 ) ) ERROR: Illegal Haskell 98 class constraint in inferred type *** Expression : let {...} in (f 'a',f 123) *** Type : Num Char => (Bool,Bool)
Prelude>
This happend because Num Char can never be satisfied with a predicate evidence. However in hugs without 98 mode the result of the previos line is :
Prelude> :t ( let f = \x -> x == x in (f 'a' , f 123 ) ) let {...} in (f 'a',f 123) :: Num Char => (Bool,Bool)
This (maybe) indicates how hugs make evidence elimination in runtime while Haskell 98 don´t do that. I don´t have a clear idea about this, please someone can help me?. Thanks.
AFAICT, this is a consequence of the monomorphism restriction, which is discussed in section 4.5.5 of the Haskell report: http://haskell.org/onlinereport/decls.html#sect4.5.5 -- Glynn Clements <glynn.clements@virgin.net>