
8 Oct
2009
8 Oct
'09
11:14 a.m.
On Thu, Oct 8, 2009 at 12:48 PM, Lennart Augustsson
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