On Thu, Oct 8, 2009 at 12:48 PM, Lennart Augustsson
<lenn...@augustsson.net> wrote:
> The reason a gets a single type is the monomorphism restriction (read
> the report).
> Using NoMonomorphismRestriction your example with a works fine.

Could you explain why, under NoMonomorphismRestriction, this typechecks:

let a = 1 in (a + (1 :: Int),a + (1 :: Float))

while this not:

foo :: Num a => a -> (Int,Float)
foo k = (k + (1 :: Int), k + (1.0 :: Float))

Thanks!

Cristiano
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to