0
有沒有辦法繞IO Double
?我在尋找一個功能:Round IO Double到指定的位數 - Haskell
ownRound :: IO Double -> IO Double
這些單元測試:
ownRound 0.51 == 0.5
ownRound 0.49 == 0.5
ownRound 0.5 == 0.5
ownRound 0.7132 == 0.7
ownRound 0.39 == 0.4
'fmap ::(a - > b) - >(IO a - > IO b)'是可能的。 – AJFarmar
@AJFarmar,是的,我明白了。 – Denis