haskus-binary-1.5: Haskus binary format manipulation

Safe HaskellNone
LanguageHaskell2010

Haskus.Binary.Bits.Rotate

Description

Bit rotations

Synopsis

Documentation

class RotatableBits a where Source #

Types whose bits can be rotated

Minimal complete definition

Nothing

Methods

rotate :: a -> Int -> a Source #

Rotate left if positive, right if negative

rotate :: (FiniteBits a, KnownNat (BitSize a)) => a -> Int -> a Source #

Rotate left if positive, right if negative

rotateL :: a -> Word -> a Source #

Checked left bit rotation

rotateL :: (FiniteBits a, KnownNat (BitSize a)) => a -> Word -> a Source #

Checked left bit rotation

rotateR :: a -> Word -> a Source #

Checked right bit rotation

rotateR :: (FiniteBits a, KnownNat (BitSize a)) => a -> Word -> a Source #

Checked right bit rotation

uncheckedRotate :: a -> Int -> a Source #

Unchecked rotate left if positive, right if negative

uncheckedRotateL :: a -> Word -> a Source #

Unchecked left bit rotation

uncheckedRotateL :: (ShiftableBits a, FiniteBits a, KnownNat (BitSize a), Bitwise a) => a -> Word -> a Source #

Unchecked left bit rotation

uncheckedRotateR :: a -> Word -> a Source #

Unchecked right bit rotation

uncheckedRotateR :: (ShiftableBits a, FiniteBits a, KnownNat (BitSize a), Bitwise a) => a -> Word -> a Source #

Unchecked right bit rotation

Instances
RotatableBits Int Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Int8 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Int16 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Int32 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Int64 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Word Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Word8 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Word16 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Word32 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits Word64 Source # 
Instance details

Defined in Haskus.Binary.Bits.Rotate

RotatableBits a => RotatableBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

RotatableBits a => RotatableBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

(Storable a, Bits a, KnownNat n, KnownNat (n * BitSize a)) => RotatableBits (Vector n a) Source # 
Instance details

Defined in Haskus.Binary.Vector

Methods

rotate :: Vector n a -> Int -> Vector n a Source #

rotateL :: Vector n a -> Word -> Vector n a Source #

rotateR :: Vector n a -> Word -> Vector n a Source #

uncheckedRotate :: Vector n a -> Int -> Vector n a Source #

uncheckedRotateL :: Vector n a -> Word -> Vector n a Source #

uncheckedRotateR :: Vector n a -> Word -> Vector n a Source #