[Haskell-beginners] Haskell typing question
Brandon Allbery
allbery.b at gmail.com
Sun Oct 26 22:51:16 UTC 2014
On Sun, Oct 26, 2014 at 6:52 PM, Cui Liqiang <cui.liqiang at gmail.com> wrote:
> Why Haskell insists that 10.0 is a Int? How can I explicitly tell Haskell
> I want a Fractional?
>
Because digitToInt means exactly what it says. If you want it to become
something other than Int, apply fromIntegral to its result.
--
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20141026/898c66cd/attachment.html>
More information about the Beginners
mailing list