似乎提高Complex Int权力违反了某些合同.我错了吗?
以下最小例子
compl :: Complex Int -> Maybe (Complex Int)
compl d = (d^) <$> Just 3
Run Code Online (Sandbox Code Playgroud)
并且错误消息:
No instance for (RealFloat Int) arising from an operator section
In the first argument of ‘(<$>)’, namely ‘(d ^)’
In the expression: (d ^) <$> Just 3
In an equation for ‘compl’: compl d = (d ^) <$> Just 3
Run Code Online (Sandbox Code Playgroud)
有没有办法解决?允许这种类型是浮点数在我的程序中没有任何意义.