我是Haskell的新手,并试图使用从Data.Bits按位操作。每次我尝试,我得到一个错误信息Haskell按位运算符Data.Bits
Prelude Data.Bits> 1 `shiftL` 16
<interactive>:1:0:
Ambiguous type variable `t' in the constraint:
`Bits t' arising from a use of `shiftL' at <interactive>:1:0-12
Probable fix: add a type signature that fixes these type variable(s)
发生这种情况的多项业务,我也尝试过。|。和。 &。
我必须失去了一些东西很简单,请让我知道你是否能发现问题
你可以发布你的ghc版本吗? 'GHCi,版本7.0.4'工作正常。 'ghci> 1 \'shiftL \'16 - 输出 65536' – Pikaurd 2012-04-28 03:32:13