
Am Montag 01 Juni 2009 14:44:37 schrieb Vladimir Reshetnikov:
Hi,
I tried this code:
----------------------- f, g :: a -> a (f, g) = (id, id) -----------------------
Hugs: OK
GHC: Couldn't match expected type `forall a. a -> a' against inferred type `a -> a' In the expression: id In the expression: (id, id) In a pattern binding: (f, g) = (id, id)
What does mean this error message? And what of them (Hugs, GHC) is correct?
http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs-and-infelicitie... Section 12.1.1.4, Declarations and bindings GHC's typechecker makes all pattern bindings monomorphic by default; this behaviour can be disabled with -XNoMonoPatBinds. See Section 7.1, “Language options”. Hugs is correct, it's a known infelicity in GHC which can be disabled.
Thanks Vladimir