[Haskell-cafe] Is this related to monomorphism restriction?

Maurí­cio briqueabraque at yahoo.com
Sat Dec 20 18:28:40 EST 2008


Why isn't the last line of this code allowed?

f :: (TestClass a) => a -> Integer
f = const 1
a = (f,f)
g = fst a

The only thing I can think about is monomorphism
restriction, but it's allowed (or even the third
line would not be accepted). Is there something
I could read to understand that?


More information about the Haskell-Cafe mailing list