
28 May
2008
28 May
'08
7:55 a.m.
PR Stanley
(16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here?
The literal 16 is really shorthand for "fromIntegral (16::Integer)"¹, which is a perfectly good expression for any member of the Num class -- including Float. -k ¹ Possibly it's ::Int? -- If I haven't seen further, it is by standing in the footprints of giants