2
这是一个非常愚蠢的问题,但我有点失落。这里的功能在整数类型之间转换
f :: (Bool,Int) -> Int
f (True,n) = round (2 ** n)
f (False,n) = 0
而这里的我得到
No instance for (Floating Int)
arising from a use of `**'
Possible fix: add an instance declaration for (Floating Int)
In the first argument of `round', namely `(2 ** n)'
In the expression: round (2 ** n)
In an equation for `f': f (True, n) = round (2 ** n)
我要补充,使其工作的错误?