예를 들어 펜스에서 파운드로 변환하려면 map
함수를 사용해야합니다. 어리석은 질문에 대해 유감이지만 .. 초보자입니다.부동 소수점으로 변환 Int : Num [Int]의 인스턴스가 없습니다.
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