| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Bits.Compat
Synopsis
- bitDefault :: (Bits a, Num a) => Int -> a
- testBitDefault :: (Bits a, Num a) => a -> Int -> Bool
- popCountDefault :: (Bits a, Num a) => a -> Int
- (.^.) :: Bits a => a -> a -> a
- (.>>.) :: Bits a => a -> Int -> a
- (.<<.) :: Bits a => a -> Int -> a
- (!>>.) :: Bits a => a -> Int -> a
- (!<<.) :: Bits a => a -> Int -> a
- toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b
- oneBits :: FiniteBits a => a
Documentation
bitDefault :: (Bits a, Num a) => Int -> a #
testBitDefault :: (Bits a, Num a) => a -> Int -> Bool #
popCountDefault :: (Bits a, Num a) => a -> Int #
toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b #
oneBits :: FiniteBits a => a Source #
A more concise version of complement zeroBits.
>>>complement (zeroBits :: Word) == (oneBits :: Word)True
>>>complement (oneBits :: Word) == (zeroBits :: Word)True
Note
The constraint on oneBits is arguably too strong. However, as some types
(such as Natural) have undefined complement, this is the only safe
choice.
Since: 4.16