[Hugs-users] newbie problem help pliz
Jon Fairbairn
jon.fairbairn at cl.cam.ac.uk
Sun May 14 07:18:36 EDT 2006
On 2006-05-14 at 14:38+0330 Arash wrote:
> ERROR "RN_Comp.hugs":18 - Type error in application
> *** Expression : fromInteger . fromEnum
> *** Term : fromInteger
> *** Type : Integer -> a
> *** Does not match : Int -> a
>
> which is for this function:
>
> {--------------------------------------------}
> {- moving to traditional signed-digit -}
> {--------------------------------------------}
> fromDigit :: Digit -> Integer
> fromDigit =(\n -> n - 1).fromInteger.fromEnum
>
> Could anyone help me please fix this problem?
Prelude> :t fromInteger
fromInteger :: (Num a) => Integer -> a
Prelude> :t fromIntegral
fromIntegral :: (Num b, Integral a) => a -> b
so you just need to use fromIntegral instead of fromInteger
Jón
--
Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
More information about the Hugs-Users
mailing list