Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Bytes (n :: Nat )
- data Endian
- pack :: forall n. KnownNat n => [ Word8 ] -> Bytes n
- packSome :: ( forall n. KnownNat n => Bytes n -> a) -> [ Word8 ] -> a
- unpack :: Bytes n -> [ Word8 ]
- fromBits :: forall n. KnownNat n => Endian -> FBits n -> Bytes ( Div8 n)
- toBits :: Endian -> Bytes n -> FBits (n * 8)
- append :: forall m n r. (m + n) ~ r => Bytes n -> Bytes m -> Bytes r
- take :: forall n m. ( KnownNat n, n <= m) => Bytes m -> Bytes n
- drop :: forall n m. ( KnownNat m, KnownNat n, n <= m) => Bytes m -> Bytes n
- splitHalf :: forall m n. ( KnownNat n, (n * 2) ~ m) => Bytes m -> ( Bytes n, Bytes n)
- trace :: String -> Bytes n -> Bytes n
Documentation
fromBits :: forall n. KnownNat n => Endian -> FBits n -> Bytes ( Div8 n) Source #
transform bits into bytes with a specific endianness