-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Encode binary protocols with some odd bit numbers into a bytestring -- -- Encode binary protocols with some odd bit numbers into a bytestring. @package bit-protocol @version 0.1.0.0 module Data.BitProtocol data BitsVal a BitsVal :: Int -> a -> BitsVal a [bvBitsNum] :: BitsVal a -> Int [bvVal] :: BitsVal a -> a numToWord8Array :: Integral a => BitsVal a -> [Word8] word8sToIntegral :: Integral a => [Word8] -> a -- | Convert left 8 bits to a list of Word8, while giving a leftover -- value). Assumes that the BitsVal argument's length is more than -- 8. bitsValBiggerToCharUnsafe :: Integral a => BitsVal a -> ([Word8], BitsVal a) roundTo8 :: Integral a => BitsVal a -> BitsVal a -- | Converts a list of chars into a bytestring via construction of 8-bit -- chars. Pads with zeroes on the right if a sum is not divisible by 8. bitsValsToBS8 :: (Integral a) => [BitsVal a] -> ByteString instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.BitProtocol.BitsVal a) instance GHC.Show.Show a => GHC.Show.Show (Data.BitProtocol.BitsVal a) instance GHC.Num.Num a => GHC.Base.Semigroup (Data.BitProtocol.BitsVal a) instance GHC.Real.Integral a => GHC.Base.Monoid (Data.BitProtocol.BitsVal a)