binrep-0.8.0: Encode precise binary representations directly in types
Safe HaskellSafe-Inferred
LanguageGHC2021

Binrep.Put.Struct

Synopsis

Documentation

class PutC a where Source #

constant size putter

Methods

putC :: a -> PutterC Source #

Instances

Instances details
(TypeError ENoEmpty :: Constraint) => PutC Void Source # 
Instance details

Defined in Binrep.Put.Struct

Methods

putC :: Void -> PutterC Source #

PutC Int8 Source #

8-bit (1-byte) words do not require byte order in order to precisely define their representation.

Instance details

Defined in Binrep.Put.Struct

Methods

putC :: Int8 -> PutterC Source #

PutC Word8 Source #

8-bit (1-byte) words do not require byte order in order to precisely define their representation.

Instance details

Defined in Binrep.Put.Struct

Methods

putC :: Word8 -> PutterC Source #

PutC PutterC Source # 
Instance details

Defined in Binrep.Put.Struct

Methods

putC :: PutterC -> PutterC Source #

PutC DMagic Source # 
Instance details

Defined in Binrep.Test

Methods

putC :: DMagic -> PutterC Source #

PutC DStruct Source # 
Instance details

Defined in Binrep.Test

Methods

putC :: DStruct -> PutterC Source #

PutC () Source #

Unit type serializes to nothing. How zen.

Instance details

Defined in Binrep.Put.Struct

Methods

putC :: () -> PutterC Source #

PutC a => PutC (Identity a) Source # 
Instance details

Defined in Binrep.Put.Struct

Methods

putC :: Identity a -> PutterC Source #

(Generic a, GPoke PutC (Rep a), GAssertNotVoid a, GAssertNotSum a) => PutC (Generically a) Source # 
Instance details

Defined in Binrep.Put.Struct

(Generic a, GPoke PutC (Rep a), GAssertNotVoid a, GAssertNotSum a) => PutC (GenericallyNonSum a) Source # 
Instance details

Defined in Binrep.Put.Struct

Prim' a => PutC (ViaPrim a) Source # 
Instance details

Defined in Binrep.Put.Struct

Methods

putC :: ViaPrim a -> PutterC Source #

(TypeError ENoSum :: Constraint) => PutC (Either a b) Source # 
Instance details

Defined in Binrep.Put.Struct

Methods

putC :: Either a b -> PutterC Source #

(bs ~ MagicBytes a, ReifyBytesW64 bs) => PutC (Magic a) Source # 
Instance details

Defined in Binrep.Type.Magic

Methods

putC :: Magic a -> PutterC Source #

(BLen a, KnownNat n, Put a) => PutC (NullPadded n a) Source # 
Instance details

Defined in Binrep.Type.NullPadded

Methods

putC :: NullPadded n a -> PutterC Source #

PutC a => PutC (Sized n a) Source # 
Instance details

Defined in Binrep.Type.Sized

Methods

putC :: Sized n a -> PutterC Source #

(Prim' a, ByteSwap a) => PutC (ByteOrdered 'BigEndian a) Source # 
Instance details

Defined in Binrep.Put.Struct

(Prim' a, ByteSwap a) => PutC (ByteOrdered 'LittleEndian a) Source # 
Instance details

Defined in Binrep.Put.Struct

PutC (ByteOrdered end Int8) Source #

Byte order is irrelevant for 8-bit (1-byte) words.

Instance details

Defined in Binrep.Put.Struct

Methods

putC :: ByteOrdered end Int8 -> PutterC Source #

PutC (ByteOrdered end Word8) Source #

Byte order is irrelevant for 8-bit (1-byte) words.

Instance details

Defined in Binrep.Put.Struct

(PutC l, KnownNat (CBLen l), PutC r) => PutC (l, r) Source #

Look weird? Yeah. But it's correct :)

Instance details

Defined in Binrep.Put.Struct

Methods

putC :: (l, r) -> PutterC Source #

GPokeBase PutC Source # 
Instance details

Defined in Binrep.Put.Struct

Associated Types

type GPokeBaseSt PutC #

type GPokeBaseC PutC a #

type GPokeBaseLenTF PutC :: Type ~> Natural #

PutC (Refined pr (Refined pl a)) => PutC (Refined (And pl pr) a) Source # 
Instance details

Defined in Binrep.Put.Struct

Methods

putC :: Refined (And pl pr) a -> PutterC Source #

type GPokeBaseLenTF PutC Source # 
Instance details

Defined in Binrep.Put.Struct

type GPokeBaseSt PutC Source # 
Instance details

Defined in Binrep.Put.Struct

type GPokeBaseC PutC a Source # 
Instance details

Defined in Binrep.Put.Struct

type GPokeBaseC PutC a = PutC a

runPutC :: forall a. (PutC a, KnownNat (CBLen a)) => a -> ByteString Source #

putGenericStruct :: forall a. (Generic a, GPoke PutC (Rep a), GAssertNotVoid a, GAssertNotSum a) => a -> PutterC Source #

Serialize a term of the struct-like type a via its Generic instance.