I am unfamiliar with haskell and just started learning it. I need to run a program developed by my master for real number calculation some years ago. First attemp to run it by hugs gives me this error message: ERROR "RN_Comp.hugs":258 - Undefined variable "%" I tryed to import Ratio, which solved the problem but after that it gives me this error message: 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 Coudl anyone help me please fix this problem? -- from debian manifesto: Debian Linux is a brand-new kind of Linux distribution. Rather than being developed by one isolated individua l or group, as other distributions of Linux have been developed in the past, Debian is being developed openly in the spirit of Linux and GNU.
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
participants (2)
-
Arash -
Jon Fairbairn