
12 Jul
2011
12 Jul
'11
10:05 a.m.
Hi,
On 12 July 2011 16:15, Brent Yorgey
This message is just because it cannot figure out the type of [] in 'putStrLn $ show $ halve []'. You can write
putStrLn $ show $ halve ([] :: [Int])
to give it an explicit type. It's a bit annoying since we happen to know that the type of the list makes no difference, but the compiler can't figure that out.
Actually, the type of the list does make a difference due to different show instances. Try: putStrLn $ show $ halve ([] :: [Char]) Cheers, Ozgur