[Haskell-cafe] coercion to Int

Thomas Hallgren hallgren at cse.ogi.edu
Fri Dec 31 13:50:49 EST 2004


james pentland wrote:

>what coercion can i use to get the below program to compile? ... various combinations of fromInteger, toInteger do not help.
>  
>
Did you try fromIntegral?

    fromIntegral :: (Integral a, Num b) => a -> b

>fnK_ :: Int -> Int
>fnK_ x = round (sqrt x)         -- line 2
>  
>
-- 
Thomas H




More information about the Haskell-Cafe mailing list