我需要使用该map
函数来获得例如便士到英镑的转换。抱歉这个愚蠢的问题..但我是初学者。
del :: Int -> Float
del x = ( fromIntegral x ) / 100
pounds :: [Int] -> [Float]
pounds = map del
我得到这个错误..
*Main> pounds 45
<interactive>:90:8:
No instance for (Num [Int])
arising from the literal `45'
Possible fix: add an instance declaration for (Num [Int])
In the first argument of `pounds', namely `45'
In the expression: pounds 45
In an equation for it': it = pounds 45