| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Type.BitRecords.Builder.LazyByteStringBuilder
Contents
Synopsis
- data BuilderBox where
- MkBuilderBox :: !Word64 -> !Builder -> BuilderBox
- bitBuilderBox :: forall (record :: BitRecord). BitStringBuilderHoley (Proxy record) BuilderBox => Proxy record -> ToBitStringBuilder (Proxy record) BuilderBox
- wrapBitBuilderBox :: forall (record :: BitRecord) wrapped. BitStringBuilderHoley (Proxy record) wrapped => (BuilderBox -> wrapped) -> Proxy record -> ToBitStringBuilder (Proxy record) wrapped
- bitBuilderBoxHoley :: forall (record :: BitRecord) r. BitStringBuilderHoley (Proxy record) r => Proxy record -> FunctionBuilder BuilderBox r (ToBitStringBuilder (Proxy record) r)
- newtype BitStringBuilder = BitStringBuilder {}
- runBitStringBuilder :: BitStringBuilder -> Builder
- bitStringBuilder :: (BitStringBuilderState -> BitStringBuilderState) -> BitStringBuilder
- appBitStringBuilder :: BitStringBuilder -> BitStringBuilderState -> BitStringBuilderState
- data BitStringBuilderState where
- BitStringBuilderState :: !Builder -> !BitStringBuilderChunk -> !Word64 -> BitStringBuilderState
- getBitStringBuilderStateBuilder :: BitStringBuilderState -> Builder
- initialBitStringBuilderState :: BitStringBuilderState
- flushBitStringBuilder :: BitStringBuilderState -> BitStringBuilderState
- appendBitString :: BitString -> BitStringBuilder
- appendStrictByteString :: ByteString -> BitStringBuilder
- runBitStringBuilderHoley :: FunctionBuilder BitStringBuilder Builder a -> a
- class BitStringBuilderHoley a r where
- type ToBitStringBuilder a r
- bitStringBuilderHoley :: a -> FunctionBuilder BitStringBuilder r (ToBitStringBuilder a r)
- type family UnsignedDemoteRep i where ...
- printBuilder :: Builder -> String
- bitStringPrinter :: BitStringBuilderHoley a String => a -> ToBitStringBuilder a String
Documentation
data BuilderBox where Source #
A wrapper around a builder derived from a BitStringBuilderState
Constructors
| MkBuilderBox :: !Word64 -> !Builder -> BuilderBox |
Instances
| Semigroup BuilderBox Source # | |
Defined in Data.Type.BitRecords.Builder.LazyByteStringBuilder Methods (<>) :: BuilderBox -> BuilderBox -> BuilderBox # sconcat :: NonEmpty BuilderBox -> BuilderBox # stimes :: Integral b => b -> BuilderBox -> BuilderBox # | |
| Monoid BuilderBox Source # | |
Defined in Data.Type.BitRecords.Builder.LazyByteStringBuilder Methods mempty :: BuilderBox # mappend :: BuilderBox -> BuilderBox -> BuilderBox # mconcat :: [BuilderBox] -> BuilderBox # | |
| IsBoxContent BuilderBox Source # | |
Defined in Data.ByteString.IsoBaseFileFormat.Box | |
bitBuilderBox :: forall (record :: BitRecord). BitStringBuilderHoley (Proxy record) BuilderBox => Proxy record -> ToBitStringBuilder (Proxy record) BuilderBox Source #
Create a Builder from a BitRecord and store it in a BuilderBox
wrapBitBuilderBox :: forall (record :: BitRecord) wrapped. BitStringBuilderHoley (Proxy record) wrapped => (BuilderBox -> wrapped) -> Proxy record -> ToBitStringBuilder (Proxy record) wrapped Source #
Like bitBuilderBox, but toFunction the result and accept as an additional
parameter a wrapper function to wrap the final result (the BuilderBox) and
toFunction the whole machiner.
bitBuilderBoxHoley :: forall (record :: BitRecord) r. BitStringBuilderHoley (Proxy record) r => Proxy record -> FunctionBuilder BuilderBox r (ToBitStringBuilder (Proxy record) r) Source #
Create a Builder from a BitRecord and store it in a BuilderBox;
return a FunctionBuilder monoid that does that on toFunction
Low-level interface to building BitRecords and other things
newtype BitStringBuilder Source #
Constructors
| BitStringBuilder | |
Fields | |
Instances
| Semigroup BitStringBuilder Source # | |
Defined in Data.Type.BitRecords.Builder.LazyByteStringBuilder Methods (<>) :: BitStringBuilder -> BitStringBuilder -> BitStringBuilder # sconcat :: NonEmpty BitStringBuilder -> BitStringBuilder # stimes :: Integral b => b -> BitStringBuilder -> BitStringBuilder # | |
| Monoid BitStringBuilder Source # | |
Defined in Data.Type.BitRecords.Builder.LazyByteStringBuilder Methods mappend :: BitStringBuilder -> BitStringBuilder -> BitStringBuilder # mconcat :: [BitStringBuilder] -> BitStringBuilder # | |
data BitStringBuilderState where Source #
Constructors
| BitStringBuilderState :: !Builder -> !BitStringBuilderChunk -> !Word64 -> BitStringBuilderState |
flushBitStringBuilder :: BitStringBuilderState -> BitStringBuilderState Source #
Write the partial buffer contents using any number of word8 The unwritten
parts of the bittr buffer are at the top. If the
63 ... (63-off-1)(63-off) ... 0
^^^^^^^^^^^^^^^^^^^
Relevant bits start to the top!appendBitString :: BitString -> BitStringBuilder Source #
Write all the bits, in chunks, filling and writing the BitString
in the BitStringBuilderState as often as necessary.
appendStrictByteString :: ByteString -> BitStringBuilder Source #
Write all the b*y*tes, into the BitStringBuilderState this allows general
purposes non-byte aligned builders.
BitString construction from BitRecords
class BitStringBuilderHoley a r where Source #
Associated Types
type ToBitStringBuilder a r Source #
Methods
bitStringBuilderHoley :: a -> FunctionBuilder BitStringBuilder r (ToBitStringBuilder a r) Source #
Instances
BitRecordField instances
type family UnsignedDemoteRep i where ... Source #
Equations
| UnsignedDemoteRep Int8 = Word8 | |
| UnsignedDemoteRep Int16 = Word16 | |
| UnsignedDemoteRep Int32 = Word32 | |
| UnsignedDemoteRep Int64 = Word64 |
Labbeled Fields
Bool
Bits
Naturals
Signed
BitRecord instances
BitRecordMember
AppendedBitRecords
EmptyBitRecord and '...Pretty'
Tracing/Debug Printing
printBuilder :: Builder -> String Source #
Print a Builder to a space seperated series of hexa-decimal bytes.
bitStringPrinter :: BitStringBuilderHoley a String => a -> ToBitStringBuilder a String Source #