binrep-0.3.1: Encode precise binary representations directly in types
Safe HaskellSafe-Inferred
LanguageHaskell2010

Binrep.Type.NullPadded

Documentation

data NullPad (n :: Natural) Source #

Instances

Instances details
(BLen a, KnownNat n) => Predicate (NullPad n :: Type) a Source # 
Instance details

Defined in Binrep.Type.NullPadded

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

Defined in Binrep.Type.NullPadded

Associated Types

type CBLen (NullPadded n a) :: Natural Source #

Methods

blen :: NullPadded n a -> BLenT Source #

(Get a, BLen a, KnownNat n) => Get (NullPadded n a) Source #

Safety: we assert actual length is within expected length (in order to calculate how much padding to parse).

Note that the consumer probably doesn't care about the content of the padding, just that the data is chunked correctly. I figure we care about correctness here, so it'd be nice to know about the padding well-formedness (i.e. that it's all nulls).

TODO maybe better definition via isolate

Instance details

Defined in Binrep.Type.NullPadded

Methods

get :: Getter (NullPadded n a) Source #

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

Defined in Binrep.Type.NullPadded

Methods

put :: NullPadded n a -> Builder Source #

type CBLen (NullPadded n a) Source # 
Instance details

Defined in Binrep.Type.NullPadded

type CBLen (NullPadded n a) = n

type NullPadded n a = Refined (NullPad n) a Source #