flat-0.4.4: Principled and efficient bit-oriented binary serialization.

Safe HaskellNone
LanguageHaskell2010

Flat.Encoder.Prim

Contents

Description

Encoding Primitives

Synopsis

Documentation

eBits16F :: NumBits -> Word16 -> Prim Source #

Encode up to 9 bits

eBitsF :: NumBits -> Word8 -> Prim Source #

Encode up to 8 bits.

eUTF16F :: Text -> Prim Source #

Encode text as UTF16 and encode the result as an array of bytes Efficient, as Text is already internally encoded as UTF16.

eUTF8F :: Text -> Prim Source #

Encode text as UTF8 and encode the result as an array of bytes PROB: encodeUtf8 calls a C primitive, not compatible with GHCJS (fixed in latest versions of GHCJS?)

eLazyBytesF :: ByteString -> Prim Source #

Encode a Lazy ByteString

varWordF :: (Bits t, Integral t) => t -> Prim Source #

w7l :: (Bits t, Integral t) => t -> [Word8] Source #

Exported for testing only