[Haskell-cafe] coercion to Int

james pentland james_pentland at yahoo.com
Thu Dec 30 13:29:00 EST 2004


what coercion can i use to get the below program to
compile?

i see 
    class  (Real a, Fractional a) => RealFrac a  where
    round  :: (Integral b) => a -> b

and 
    class  (Fractional a) => Floating a  where
    sqrt      :: a -> a




fillK_ :: Int -> Int
fillK_ x = round (sqrt x)         -- line 2






Hugs session for:
H:\Program Files\Hugs98\lib\Prelude.hs
Prelude> :load xva
Reading file "xva.hs":
Type checking
ERROR "xva.hs":2 - Instances of (RealFrac Int,
Floating Int) required for definition of fillK_



		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 


More information about the Haskell-Cafe mailing list