binrep-1.0.0: Encode precise binary representations directly in types
Safe HaskellNone
LanguageGHC2021

Binrep.Type.Derived.NullTermPadded

Description

Null-terminated, then null-padded data.

This is defined using the composition of existing NullTerminate and NullPad predicates, plus the re-associating binrep instances for the And predicate combinator. It kind of just magically works.

Synopsis

Documentation

type NullTermPad (n :: Natural) = And NullTerminate (NullPad n) Source #

Predicate for null-terminated, then null-padded data.

type NullTermPadded (n :: Natural) = Refined (NullTermPad n) Source #

Null-terminated data, which is then null-padded to the given length.

Instantiate with ByteString for a null-padded C string.