Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types with finite bit count
Synopsis
- class FiniteBits a where
- type BitSize a :: Nat
- bitSize :: (Integral i, KnownNat (BitSize a)) => a -> i
- zeroBits :: a
- oneBits :: a
- countLeadingZeros :: a -> Word
- countTrailingZeros :: a -> Word
- complement :: a -> a
Documentation
class FiniteBits a where Source #
Type representable by a fixed amount of bits
bitSize :: (Integral i, KnownNat (BitSize a)) => a -> i Source #
Number of bits (the value is ignored)
All bits set to 0
All bits set to 1
countLeadingZeros :: a -> Word Source #
Count number of zero bits preceding the most significant set bit
countTrailingZeros :: a -> Word Source #
Count number of zero bits following the least significant set bit
complement :: a -> a Source #
Complement