小编pu2*_*ppy的帖子

Data.Bits中的Haskell按位运算符

我是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)
Run Code Online (Sandbox Code Playgroud)

对于许多操作都会发生这种情况,我也试过了.和.&.

我必须错过一些非常简单的事情,如果你能发现问题,请告诉我

haskell bit-manipulation

1
推荐指数
1
解决办法
5662
查看次数

标签 统计

bit-manipulation ×1

haskell ×1