Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Builder = BuilderFor StrictByteStringBackend
- class Put a where
- runPut :: Put a => a -> ByteString
- runBuilder :: Builder -> ByteString
- class PutWith r a where
- putWithout :: Put a => a -> Either String Builder
- runPutWith :: PutWith r a => r -> a -> Either String ByteString
Documentation
Instances
Put Int8 Source # | |
Put Word8 Source # | |
Put DCS Source # | |
Put DSS Source # | |
Put DU Source # | |
Put Tar Source # | |
Put Tiff Source # | |
Put WavHeader Source # | |
Put ByteString Source # | Serialize the bytestring as-is. Careful -- the only way you're going to be able to parse this is to read until EOF. |
Defined in Binrep.Put put :: ByteString -> Builder Source # | |
(bs ~ MagicVals (TiffMagic end), ByteVals bs, irep ~ I 'U 'I4 end, Put irep) => Put (TiffBody end) Source # | |
Put (AsciiNat 8) Source # | |
Put (AsByteString 'C) Source # | |
Defined in Binrep.Type.ByteString | |
(itype ~ I 'U size end, irep ~ IRep 'U size, Put itype, Num irep) => Put (AsByteString ('Pascal size end)) Source # | |
Defined in Binrep.Type.ByteString | |
KnownSymbol str => Put (MagicUTF8 str) Source # | |
Put a => Put [a] Source # | Serialize each element in order. No length indicator, so parse until either error or EOF. Usually not what you want, but sometimes used at the "top" of binary formats. |
Defined in Binrep.Put | |
(Put a, BLen a) => Put (Table 'Strong a) Source # | |
KnownNat n => Put (TarNat n) Source # | No need to check for underflow etc. as TarNat guarantees good sizing. |
(bs ~ MagicVals a, ByteVals bs) => Put (Magic a) Source # | Forces magic values to be individual bytes. |
(Put a, BLen a, KnownNat n) => Put (NullPadded n a) Source # | |
Defined in Binrep.Type.NullPadded put :: NullPadded n a -> Builder Source # | |
Put a => Put (Sized n a) Source # | |
Put a => Put (Vector n a) Source # | |
(Put a, Put b) => Put (a, b) Source # | |
Defined in Binrep.Put | |
Put (I 'S 'I1 e) Source # | |
Put (I 'S 'I2 'BE) Source # | |
Put (I 'S 'I2 'LE) Source # | |
Put (I 'S 'I4 'BE) Source # | |
Put (I 'S 'I4 'LE) Source # | |
Put (I 'S 'I8 'BE) Source # | |
Put (I 'S 'I8 'LE) Source # | |
Put (I 'U 'I1 e) Source # | |
Put (I 'U 'I2 'BE) Source # | |
Put (I 'U 'I2 'LE) Source # | |
Put (I 'U 'I4 'BE) Source # | |
Put (I 'U 'I4 'LE) Source # | |
Put (I 'U 'I8 'BE) Source # | |
Put (I 'U 'I8 'LE) Source # | |
(itype ~ I 'U size end, irep ~ IRep 'U size, Put a, Put itype, Num irep) => Put (LenPfx size end a) Source # | |
runPut :: Put a => a -> ByteString Source #
Run the serializer.
runBuilder :: Builder -> ByteString Source #
class PutWith r a where Source #
Put with inlined checks via an environment.
Nothing
putWithout :: Put a => a -> Either String Builder Source #
Helper for wrapping a BinRep
into a BinRepWith
(for encoding).
runPutWith :: PutWith r a => r -> a -> Either String ByteString Source #
Run the serializer with the given environment.