binrep-0.1.0: Encode binary representations via types.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Binrep.Types.Strings

Synopsis

Documentation

data StrRep Source #

TODO

Constructors

C 
Pascal ISize Endianness 

newtype Str (rep :: StrRep) Source #

TODO

We also use this as a predicate, because the Pascal constructor looks identical to what we would want for a LengthPrefixed predicate.

Constructors

Str 

Fields

Instances

Instances details
BinaryCodecWith _r (Str 'C) Source # 
Instance details

Defined in Binrep.Types.Strings

Methods

toBinWith :: _r -> Str 'C -> Either String Builder Source #

fromBinWith :: _r -> Get (Str 'C) Source #

ByteLen (Str 'C) Source # 
Instance details

Defined in Binrep.Types.Strings

Methods

blen :: Str 'C -> Natural Source #

ByteLen (I 'U size e) => ByteLen (Str ('Pascal size e)) Source # 
Instance details

Defined in Binrep.Types.Strings

Methods

blen :: Str ('Pascal size e) -> Natural Source #

BinaryCodec (Str 'C) Source #

Total shite parsing efficiency. But, to be fair, that's why we don't serialize arbitrary-length C strings!

Instance details

Defined in Binrep.Types.Strings

Methods

toBin :: Putter (Str 'C) Source #

fromBin :: Get (Str 'C) Source #

(Foldable f, Typeable f, Typeable e) => Predicate (LenPfx 'I4 e) (f a) Source # 
Instance details

Defined in Binrep.Types.Strings

Methods

validate :: Proxy (LenPfx 'I4 e) -> f a -> Maybe RefineException #

(ByteLen a, itype ~ I 'U size e, ByteLen itype) => ByteLen (WithRefine 'Enforced (LenPfx size e) a) Source #

TODO why safe

Instance details

Defined in Binrep.Types.Strings

Methods

blen :: WithRefine 'Enforced (LenPfx size e) a -> Natural Source #

(BinaryCodec a, irep ~ IRep 'U size, itype ~ I 'U size e, Num irep, Integral irep, BinaryCodec itype) => BinaryCodec (WithRefine 'Enforced (LenPfx size e) [a]) Source #

TODO why safe

Instance details

Defined in Binrep.Types.Strings

Methods

toBin :: Putter (WithRefine 'Enforced (LenPfx size e) [a]) Source #

fromBin :: Get (WithRefine 'Enforced (LenPfx size e) [a]) Source #

BinaryCodec (WithRefine 'Enforced WellSized (Str ('Pascal 'I1 e))) Source #

TODO explain why safe

Instance details

Defined in Binrep.Types.Strings

data WellSized Source #

Instances

Instances details
BinaryCodec (WithRefine 'Enforced WellSized (Str ('Pascal 'I1 e))) Source #

TODO explain why safe

Instance details

Defined in Binrep.Types.Strings

type LenPfx size e = Str ('Pascal size e) Source #