PR Stanley <[EMAIL PROTECTED]> writes:

> (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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to