License | BSD-style |
---|---|
Maintainer | Haskell Foundation |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
class BitOps bits where Source #
operation over bits
(.&.) :: bits -> bits -> bits Source #
(.|.) :: bits -> bits -> bits Source #
(.^.) :: bits -> bits -> bits Source #
(.<<.) :: bits -> CountOf Bool -> bits Source #
(.>>.) :: bits -> CountOf Bool -> bits Source #
bit :: Offset Bool -> bits Source #
construct a bit set with the bit at the given index set.
bit :: Integral bits => Offset Bool -> bits Source #
construct a bit set with the bit at the given index set.
isBitSet :: bits -> Offset Bool -> Bool Source #
test the bit at the given index is set
isBitSet :: (Integral bits, Eq bits) => bits -> Offset Bool -> Bool Source #
test the bit at the given index is set
setBit :: bits -> Offset Bool -> bits Source #
set the bit at the given index
setBit :: Integral bits => bits -> Offset Bool -> bits Source #
set the bit at the given index
clearBit :: bits -> Offset Bool -> bits Source #
clear the bit at the given index
clearBit :: FiniteBitsOps bits => bits -> Offset Bool -> bits Source #
clear the bit at the given index
class FiniteBitsOps bits where Source #
operation over finit bits
numberOfBits :: bits -> CountOf Bool Source #
get the number of bits in the given object
rotateL :: bits -> CountOf Bool -> bits Source #
rotate the given bit set.
rotateR :: bits -> CountOf Bool -> bits Source #
rotate the given bit set.
popCount :: bits -> CountOf Bool Source #
count of number of bit set to 1 in the given bit set.
bitFlip :: bits -> bits Source #
reverse all bits in the argument
countLeadingZeros :: bits -> CountOf Bool Source #
count of the number of leading zeros
countLeadingZeros :: BitOps bits => bits -> CountOf Bool Source #
count of the number of leading zeros
countTrailingZeros :: bits -> CountOf Bool Source #
count of the number of trailing zeros
countTrailingZeros :: BitOps bits => bits -> CountOf Bool Source #
count of the number of trailing zeros
Bool set of n
bits.
SizeValid n => Bounded (Bits n) Source # | |
SizeValid n => Enum (Bits n) Source # | |
Eq (Bits n) Source # | |
Ord (Bits n) Source # | |
Show (Bits n) Source # | |
SizeValid n => Subtractive (Bits n) Source # | |
SizeValid n => Additive (Bits n) Source # | |
SizeValid n => IDivisible (Bits n) Source # | |
SizeValid n => Multiplicative (Bits n) Source # | |
SizeValid n => BitOps (Bits n) Source # | |
(SizeValid n, NatWithinBound (CountOf Bool) n) => FiniteBitsOps (Bits n) Source # | |
type Difference (Bits n) Source # | |