
8 Oct
2009
8 Oct
'09
11:35 a.m.
Hello Cristiano, Thursday, October 8, 2009, 7:14:20 PM, you wrote:
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))
i think it's because type is different: foo :: (forall a. (Num a) => a) -> (Int,Float) in first equation it probably inferred correctly -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com