我是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