Safe Haskell | None |
---|---|
Language | Haskell2010 |
Foundation.Bits
Synopsis
- (.<<.) :: Bits a => a -> Int -> a
- (.>>.) :: Bits a => a -> Int -> a
- class Eq a => Bits a where
- (.&.) :: a -> a -> a
- (.|.) :: a -> a -> a
- xor :: a -> a -> a
- complement :: a -> a
- shift :: a -> Int -> a
- rotate :: a -> Int -> a
- zeroBits :: a
- bit :: Int -> a
- setBit :: a -> Int -> a
- clearBit :: a -> Int -> a
- complementBit :: a -> Int -> a
- testBit :: a -> Int -> Bool
- bitSizeMaybe :: a -> Maybe Int
- bitSize :: a -> Int
- isSigned :: a -> Bool
- shiftL :: a -> Int -> a
- unsafeShiftL :: a -> Int -> a
- shiftR :: a -> Int -> a
- unsafeShiftR :: a -> Int -> a
- rotateL :: a -> Int -> a
- rotateR :: a -> Int -> a
- popCount :: a -> Int
- alignRoundUp :: Int -> Int -> Int
- alignRoundDown :: Int -> Int -> Int
Documentation
Minimal complete definition
(.&.), (.|.), xor, complement, (shift | shiftL, shiftR), (rotate | rotateL, rotateR), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount
Methods
complement :: a -> a #
complementBit :: a -> Int -> a #
bitSizeMaybe :: a -> Maybe Int #
unsafeShiftL :: a -> Int -> a #
unsafeShiftR :: a -> Int -> a #
Instances
Round up (if needed) to a multiple of alignment
closst to m
alignment
needs to be a power of two
alignRoundUp 16 8 = 16 alignRoundUp 15 8 = 16