Safe Haskell | None |
---|---|
Language | Haskell2010 |
NamedStructure definition for sequences of bits.
This module provides the core data types and functions for conversion of finite bit sequences from an to conventional (Haskell) data types.
Non-compressed, non-random finite bit sequences generated by programs are usually compositions of bytes and multi byte words, and a ton of Haskell libraries exist for the serialization and deserialization of ByteStrings.
This module allows the definition of a structure i.e. a very simple grammar, which allows functions in this library to read and write single bytes, words and bits.
Also complete bit sequence may be constructed or destructed from and to Haskell types.
Further more, the structures may contain dependent sub-sequences, for example to express structures that precede a length field before a repetitive block data.
Antother example for dependent sequences is fields whose presence depends on flags preceding them.
This library is also designed with zero copying in mind.
It should be emphasized that binary deserialization is not to be confused with binary destructuring. While the former usually involves copying all regular sub sequences from the input to a value of a certain type, the later merely requires to peek into the sequeuence at a certain position and deserializing a sub sequence. The starting position and the interpretation are governed by the strucuture applied to the sequence.
Synopsis
- data BitRecord where
- EmptyBitRecord :: BitRecord
- BitRecordMember :: Extends (BitRecordField t) -> BitRecord
- RecordField :: Extends (BitField rt st size) -> BitRecord
- BitRecordAppend :: BitRecord -> BitRecord -> BitRecord
- type family WhenR (b :: Bool) (x :: BitRecord) :: BitRecord where ...
- type family SizeInBits (x :: k) :: Nat where ...
- type family SizeInBytes (c :: k) :: Nat
- type Bits2Bytes (bitSize :: Nat) = Bits2Bytes2 (Div bitSize 8) (Mod bitSize 8)
- type family Bits2Bytes2 (bitSizeDiv8 :: Nat) (bitSizeMod8 :: Nat) :: Nat where ...
- type family BitRecordMemberCount (b :: BitRecord) :: Nat where ...
- getRecordSizeFromProxy :: forall px (rec :: BitRecord). KnownNat (SizeInBits rec) => px rec -> Integer
- type OptionalRecordOf (f :: Extends (s -> Extends BitRecord)) (x :: Maybe s) = (Optional (Konst EmptyBitRecord) f $ x :: Extends BitRecord)
- data (l :: BitRecord) :+^ (r :: Extends BitRecord) :: Extends BitRecord
- data (l :: Extends BitRecord) :^+ (r :: BitRecord) :: Extends BitRecord
- type (:+:) (l :: BitRecord) (r :: BitRecord) = (l `Append` r :: BitRecord)
- type family Append (l :: BitRecord) (r :: BitRecord) :: BitRecord where ...
- type (:+.) (r :: BitRecord) (f :: Extends (BitRecordField t1)) = Append r (BitRecordMember f)
- type (.+:) (f :: Extends (BitRecordField t1)) (r :: BitRecord) = Append (BitRecordMember f) r
- type (.+.) (l :: Extends (BitRecordField t1)) (r :: Extends (BitRecordField t2)) = Append (BitRecordMember l) (BitRecordMember r)
- type family (field :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: k) (len :: Nat)))) :~ (value :: Extends (FieldValue (label :: Symbol) st)) :: Extends (BitRecordField t) where ...
- type family (fld :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: k) (len :: Nat)))) :~? (value :: Maybe (Extends (FieldValue (label :: Symbol) st))) :: Extends BitRecord where ...
- type family (fld :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: k) (len :: Nat)))) :+? (value :: Maybe (Extends (FieldValue (label :: Symbol) st))) :: BitRecord where ...
- data FieldValue :: Symbol -> staticRep -> Type
- data StaticFieldValue (label :: Symbol) :: staticRep -> Extends (FieldValue label staticRep)
- data RuntimeFieldValue (label :: Symbol) :: Extends (FieldValue label staticRep)
- data RecArray :: BitRecord -> Nat -> Extends BitRecord
- type (^^) r n = RecArray r n
- type family RecArrayToBitRecord (r :: BitRecord) (n :: Nat) :: BitRecord where ...
- data BitRecordOfList (f :: Extends (foo -> BitRecord)) (xs :: [foo]) :: Extends BitRecord
- type BitRecordAppendFun = Fun1 BitRecordAppendFun_
- data BitRecordAppendFun_ :: BitRecord -> Extends (BitRecord -> BitRecord)
- data OptionalRecord :: Maybe BitRecord -> Extends BitRecord
- data BitRecordField :: BitField rt st len -> Type
- data MkField t :: BitRecordField t -> Type
- data LabelF :: Symbol -> Extends (BitRecordField t) -> Extends (BitRecordField t)
- type (@:) (l :: Symbol) (f :: Extends (BitRecordField (t :: BitField rt (st :: stk) size))) = (LabelF l f :: Extends (BitRecordField t))
- type (@::) (l :: Symbol) (f :: Extends a) = Labelled l f
- data (:=) :: forall st (t :: BitField rt st size). Extends (BitRecordField t) -> st -> Extends (BitRecordField t)
- data (:=.) :: Extends (BitField rt st size) -> st -> Extends (BitField rt st size)
- data BitField (runtimeRep :: Type) (staticRep :: k) (bitCount :: Nat) where
- MkFieldFlag :: BitField Bool Bool 1
- MkFieldBits :: forall (n :: Nat). BitField (B n) Nat n
- MkFieldBitsXXL :: forall (n :: Nat). BitField Integer Nat n
- MkFieldU8 :: BitField Word8 Nat 8
- MkFieldU16 :: BitField Word16 Nat 16
- MkFieldU32 :: BitField Word32 Nat 32
- MkFieldU64 :: BitField Word64 Nat 64
- MkFieldI8 :: BitField Int8 SignedNat 8
- MkFieldI16 :: BitField Int16 SignedNat 16
- MkFieldI32 :: BitField Int32 SignedNat 32
- MkFieldI64 :: BitField Int64 SignedNat 64
- MkFieldCustom :: BitField rt st n
- type family BitFieldSize (b :: BitField rt st size) :: Nat where ...
- type Flag = MkField MkFieldFlag
- type Field n = MkField (MkFieldBits :: BitField (B n) Nat n)
- type FieldU8 = MkField MkFieldU8
- type FieldU16 = MkField MkFieldU16
- type FieldU32 = Konst MkFieldU32
- type FieldU64 = MkField MkFieldU64
- type FieldI8 = MkField MkFieldI8
- type FieldI16 = MkField MkFieldI16
- type FieldI32 = MkField MkFieldI32
- type FieldI64 = MkField MkFieldI64
- newtype B (size :: Nat) = B {}
- data SignedNat where
- PositiveNat :: Nat -> SignedNat
- NegativeNat :: Nat -> SignedNat
- type family FlagJust (a :: Maybe (v :: Type)) :: Extends (BitRecordField MkFieldFlag) where ...
- type family FlagNothing (a :: Maybe (v :: Type)) :: Extends (BitRecordField MkFieldFlag) where ...
- data MaybeField :: Maybe (Extends (BitRecordField t)) -> Extends BitRecord
- data RecordField :: Extends (BitRecordField t) -> Extends BitRecord
- type family FieldWidth (x :: Extends (BitRecordField t)) where ...
- showARecord :: forall proxy (rec :: Extends BitRecord). PrettyTypeShow (PrettyRecord (From rec)) => proxy rec -> String
- showRecord :: forall proxy (rec :: BitRecord). PrettyTypeShow (PrettyRecord rec) => proxy rec -> String
- type family PrettyRecord (rec :: BitRecord) :: PrettyType where ...
- type family PrettyRecordField (f :: Extends (BitField (rt :: Type) (st :: Type) (size :: Nat))) :: PrettyType where ...
- type family PrettyField (f :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: Type) (size :: Nat)))) :: PrettyType where ...
- type family PrettyFieldType (t :: BitField (rt :: Type) (st :: Type) (size :: Nat)) :: PrettyType where ...
- type family PrettyFieldValue (t :: BitField (rt :: Type) (st :: Type) (size :: Nat)) (v :: st) :: PrettyType where ...
- type family PrettyCustomFieldValue (rt :: Type) (st :: Type) (size :: Nat) (v :: st) :: PrettyType
- type family PrintHexIfPossible t (s :: Nat) :: PrettyType where ...
Bit-Records
Bit-Record Type
BitRecordField
s assembly
EmptyBitRecord :: BitRecord | |
BitRecordMember :: Extends (BitRecordField t) -> BitRecord | |
RecordField :: Extends (BitField rt st size) -> BitRecord | |
BitRecordAppend :: BitRecord -> BitRecord -> BitRecord |
Instances
type family WhenR (b :: Bool) (x :: BitRecord) :: BitRecord where ... Source #
A conditional BitRecord
WhenR False r = EmptyBitRecord | |
WhenR True r = r |
Basic Accessor
type family SizeInBits (x :: k) :: Nat where ... Source #
Get the number of bits in a BitRecord
SizeInBits EmptyBitRecord = 0 | |
SizeInBits (BitRecordMember f) = FieldWidth f | |
SizeInBits (RecordField f) = BitFieldSize (From f) | |
SizeInBits (BitRecordAppend l r) = SizeInBits l + SizeInBits r |
type family SizeInBytes (c :: k) :: Nat Source #
For something to be augmented by a size field there must be an instance of this family to generate the value of the size field, e.g. by counting the elements.
Instances
type SizeInBytes (b :: BitRecord) Source # | |
Defined in Data.Type.BitRecords.Core | |
type SizeInBytes (Labelled l f :: a -> Type) Source # | |
Defined in Data.Type.BitRecords.Core | |
type SizeInBytes (f :=. v :: BitField rt k size -> Type) Source # | |
Defined in Data.Type.BitRecords.Core | |
type SizeInBytes (MkField t :: BitRecordField t -> Type) Source # | |
Defined in Data.Type.BitRecords.Core | |
type SizeInBytes (f := v :: BitRecordField t -> Type) Source # | |
Defined in Data.Type.BitRecords.Core | |
type SizeInBytes (LabelF l f :: BitRecordField t -> Type) Source # | |
Defined in Data.Type.BitRecords.Core | |
type SizeInBytes (t :: BitField rt st size) Source # | |
Defined in Data.Type.BitRecords.Core |
type Bits2Bytes (bitSize :: Nat) = Bits2Bytes2 (Div bitSize 8) (Mod bitSize 8) Source #
type family Bits2Bytes2 (bitSizeDiv8 :: Nat) (bitSizeMod8 :: Nat) :: Nat where ... Source #
Bits2Bytes2 bytes 0 = bytes | |
Bits2Bytes2 bytes n = bytes + 1 |
type family BitRecordMemberCount (b :: BitRecord) :: Nat where ... Source #
Get the total number of members in a record.
getRecordSizeFromProxy :: forall px (rec :: BitRecord). KnownNat (SizeInBits rec) => px rec -> Integer Source #
Get the size of the record.
type OptionalRecordOf (f :: Extends (s -> Extends BitRecord)) (x :: Maybe s) = (Optional (Konst EmptyBitRecord) f $ x :: Extends BitRecord) Source #
Either use the value from Just
or return a EmptyBitRecord
value(types(kinds))
Record composition
data (l :: BitRecord) :+^ (r :: Extends BitRecord) :: Extends BitRecord infixl 3 Source #
data (l :: Extends BitRecord) :^+ (r :: BitRecord) :: Extends BitRecord infixl 3 Source #
type family Append (l :: BitRecord) (r :: BitRecord) :: BitRecord where ... Source #
Append l EmptyBitRecord = l | |
Append EmptyBitRecord r = r | |
Append l r = BitRecordAppend l r |
type (:+.) (r :: BitRecord) (f :: Extends (BitRecordField t1)) = Append r (BitRecordMember f) infixl 6 Source #
Append a BitRecord
and a BitRecordField
type (.+:) (f :: Extends (BitRecordField t1)) (r :: BitRecord) = Append (BitRecordMember f) r infixr 6 Source #
Append a BitRecordField
and a BitRecord
type (.+.) (l :: Extends (BitRecordField t1)) (r :: Extends (BitRecordField t2)) = Append (BitRecordMember l) (BitRecordMember r) infixr 6 Source #
Append a BitRecordField
and a BitRecordField
forming a BitRecord
with
two members.
type family (field :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: k) (len :: Nat)))) :~ (value :: Extends (FieldValue (label :: Symbol) st)) :: Extends (BitRecordField t) where ... infixl 7 Source #
Set a field to either a static, compile time, value or a dynamic, runtime value.
fld :~ (StaticFieldValue l v) = (l @: fld) := v | |
fld :~ (RuntimeFieldValue l) = l @: fld |
type family (fld :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: k) (len :: Nat)))) :~? (value :: Maybe (Extends (FieldValue (label :: Symbol) st))) :: Extends BitRecord where ... infixl 7 Source #
Like :~
but for a Maybe
parameter. In case of Just
it behaves like :~
in case of Nothing
it return an EmptyBitRecord
.
fld :~? (Just v) = RecordField (fld :~ v) | |
fld :~? Nothing = Konst EmptyBitRecord |
type family (fld :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: k) (len :: Nat)))) :+? (value :: Maybe (Extends (FieldValue (label :: Symbol) st))) :: BitRecord where ... infixl 7 Source #
Like :~
but for a Maybe
parameter. In case of Just
it behaves like :~
in case of Nothing
it return an EmptyBitRecord
.
fld :+? (Just v) = BitRecordMember (fld :~ v) | |
fld :+? Nothing = EmptyBitRecord |
data FieldValue :: Symbol -> staticRep -> Type Source #
The field value parameter for :~
, either a static, compile time, value or
a dynamic, runtime value.
data StaticFieldValue (label :: Symbol) :: staticRep -> Extends (FieldValue label staticRep) Source #
data RuntimeFieldValue (label :: Symbol) :: Extends (FieldValue label staticRep) Source #
Record Arrays and Repitition
data RecArray :: BitRecord -> Nat -> Extends BitRecord Source #
An array of records with a fixed number of elements, NOTE: this type is
actually not really necessary since ReplicateRecord
exists, but this allows
to have a different showRecord
output.
type family RecArrayToBitRecord (r :: BitRecord) (n :: Nat) :: BitRecord where ... Source #
Repeat a bit record n
times.
RecArrayToBitRecord r 0 = EmptyBitRecord | |
RecArrayToBitRecord r 1 = r | |
RecArrayToBitRecord r n = Append r (RecArrayToBitRecord r (n - 1)) |
Lists of Records
data BitRecordOfList (f :: Extends (foo -> BitRecord)) (xs :: [foo]) :: Extends BitRecord Source #
Let type level lists also be records
Instances
type From (BitRecordOfList f xs :: BitRecord -> Type) Source # | |
Defined in Data.Type.BitRecords.Core type From (BitRecordOfList f xs :: BitRecord -> Type) = FoldMap BitRecordAppendFun EmptyBitRecord f xs |
Maybe Record
data OptionalRecord :: Maybe BitRecord -> Extends BitRecord Source #
Either use the value from Just
or return a EmptyBitRecord
value(types(kinds))
Instances
type From (OptionalRecord (Nothing :: Maybe BitRecord)) Source # | |
Defined in Data.Type.BitRecords.Core | |
type From (OptionalRecord (Just t) :: BitRecord -> Type) Source # | |
Defined in Data.Type.BitRecords.Core |
Field ADT
data BitRecordField :: BitField rt st len -> Type Source #
A family of bit fields.
A bit field always has a size, i.e. the number of bits it uses, as well as a term level value type and a type level value type. It also has an optional label, and an optional value assigned to it.
Instances
data MkField t :: BitRecordField t -> Type Source #
A bit record field with a number of bits
Instances
Setting a Label
data LabelF :: Symbol -> Extends (BitRecordField t) -> Extends (BitRecordField t) Source #
A bit record field with a number of bits
Instances
HasFunctionBuilder BitBuilder (Proxy nested) => HasFunctionBuilder BitBuilder (Proxy (LabelF l nested)) Source # | |
Defined in Data.Type.BitRecords.Builder.LazyByteStringBuilder type ToFunction BitBuilder (Proxy (LabelF l nested)) r :: Type # toFunctionBuilder :: Proxy (LabelF l nested) -> FunctionBuilder BitBuilder r (ToFunction BitBuilder (Proxy (LabelF l nested)) r) # | |
DynamicContent BitBuilder (Proxy nested) b => DynamicContent BitBuilder (Proxy (LabelF l nested)) b Source # | |
Defined in Data.Type.BitRecords.Builder.LazyByteStringBuilder addParameter :: Proxy (LabelF l nested) -> FunctionBuilder BitBuilder next (b -> next) # | |
type ToFunction BitBuilder (Proxy (LabelF l nested)) a Source # | |
type SizeInBytes (LabelF l f :: BitRecordField t -> Type) Source # | |
Defined in Data.Type.BitRecords.Core |
type (@:) (l :: Symbol) (f :: Extends (BitRecordField (t :: BitField rt (st :: stk) size))) = (LabelF l f :: Extends (BitRecordField t)) infixr 8 Source #
A field with a label assigned to it.
type (@::) (l :: Symbol) (f :: Extends a) = Labelled l f infixr 8 Source #
A field with a label assigned to it.
Assignment
data (:=) :: forall st (t :: BitField rt st size). Extends (BitRecordField t) -> st -> Extends (BitRecordField t) infixl 7 Source #
A field with a value set at compile time.
Instances
data (:=.) :: Extends (BitField rt st size) -> st -> Extends (BitField rt st size) infixl 7 Source #
A field with a value set at compile time.
Instances
data BitField (runtimeRep :: Type) (staticRep :: k) (bitCount :: Nat) where Source #
Types of this kind define the basic type of a BitRecordField
. Sure, this
could have been an open type, but really, how many actual useful field types
exist? Well, from a global perspective, uncountable infinite, but the focus
of this library is to blast out bits over the network, using usual Haskell
libraries, and hence, there is actually only very little reason to
differentiate types of record fields, other than what low-level library
function to apply and how to pretty print the field.
MkFieldFlag :: BitField Bool Bool 1 | |
MkFieldBits :: forall (n :: Nat). BitField (B n) Nat n | |
MkFieldBitsXXL :: forall (n :: Nat). BitField Integer Nat n | |
MkFieldU8 :: BitField Word8 Nat 8 | |
MkFieldU16 :: BitField Word16 Nat 16 | |
MkFieldU32 :: BitField Word32 Nat 32 | |
MkFieldU64 :: BitField Word64 Nat 64 | |
MkFieldI8 :: BitField Int8 SignedNat 8 | |
MkFieldI16 :: BitField Int16 SignedNat 16 | |
MkFieldI32 :: BitField Int32 SignedNat 32 | |
MkFieldI64 :: BitField Int64 SignedNat 64 | |
MkFieldCustom :: BitField rt st n |
Instances
type family BitFieldSize (b :: BitField rt st size) :: Nat where ... Source #
BitFieldSize (b :: BitField rt st size) = size |
type Flag = MkField MkFieldFlag Source #
type FieldU16 = MkField MkFieldU16 Source #
type FieldU32 = Konst MkFieldU32 Source #
type FieldU64 = MkField MkFieldU64 Source #
type FieldI16 = MkField MkFieldI16 Source #
type FieldI32 = MkField MkFieldI32 Source #
type FieldI64 = MkField MkFieldI64 Source #
newtype B (size :: Nat) Source #
A data type for Field
and MkFieldBits
, that is internally a Word64
.
It carries the number of relevant bits in its type.
Instances
A signed field value.
PositiveNat :: Nat -> SignedNat | |
NegativeNat :: Nat -> SignedNat |
Instances
Composed Fields
type family FlagJust (a :: Maybe (v :: Type)) :: Extends (BitRecordField MkFieldFlag) where ... Source #
A Flag (1-bit) that is true if the type level maybe is Just
.
type family FlagNothing (a :: Maybe (v :: Type)) :: Extends (BitRecordField MkFieldFlag) where ... Source #
A Flag (1-bit) that is true if the type level maybe is Nothing
.
FlagNothing (Just x) = Flag := False | |
FlagNothing Nothing = Flag := True |
data MaybeField :: Maybe (Extends (BitRecordField t)) -> Extends BitRecord Source #
An optional field in a bit record
Instances
type From (MaybeField (Nothing :: Maybe (Extends (BitRecordField t))) :: BitRecord -> Type) Source # | |
Defined in Data.Type.BitRecords.Core type From (MaybeField (Nothing :: Maybe (Extends (BitRecordField t))) :: BitRecord -> Type) = EmptyBitRecord | |
type From (MaybeField (Just fld) :: BitRecord -> Type) Source # | |
Defined in Data.Type.BitRecords.Core |
data RecordField :: Extends (BitRecordField t) -> Extends BitRecord Source #
A BitRecordField
can be used as BitRecordMember
Instances
type From (RecordField f :: BitRecord -> Type) Source # | |
Defined in Data.Type.BitRecords.Core |
type family FieldWidth (x :: Extends (BitRecordField t)) where ... Source #
Calculate the size as a number of bits from a BitRecordField
FieldWidth (x :: Extends (BitRecordField (t :: BitField rt st size))) = size |
Field and Record PrettyType Instances
showARecord :: forall proxy (rec :: Extends BitRecord). PrettyTypeShow (PrettyRecord (From rec)) => proxy rec -> String Source #
Render rec
to a pretty, human readable form. Internally this is a wrapper
around ptShow
using PrettyRecord
.
showRecord :: forall proxy (rec :: BitRecord). PrettyTypeShow (PrettyRecord rec) => proxy rec -> String Source #
Render rec
to a pretty, human readable form. Internally this is a wrapper
around ptShow
using PrettyRecord
.
type family PrettyRecord (rec :: BitRecord) :: PrettyType where ... Source #
PrettyRecord (BitRecordMember m) = PrettyField m | |
PrettyRecord (RecordField m) = PrettyRecordField m | |
PrettyRecord EmptyBitRecord = PrettyNewline | |
PrettyRecord (BitRecordAppend l r) = PrettyRecord l <$$> PrettyRecord r |
type family PrettyRecordField (f :: Extends (BitField (rt :: Type) (st :: Type) (size :: Nat))) :: PrettyType where ... Source #
PrettyRecordField (Konst t) = PrettyFieldType t | |
PrettyRecordField (f :=. v) = (PrettyRecordField f <+> PutStr ":=") <+> PrettyFieldValue (From f) v | |
PrettyRecordField (Labelled l f) = l <:> PrettyRecordField f |
type family PrettyField (f :: Extends (BitRecordField (t :: BitField (rt :: Type) (st :: Type) (size :: Nat)))) :: PrettyType where ... Source #
PrettyField (MkField t) = PrettyFieldType t | |
PrettyField ((f :: Extends (BitRecordField t)) := v) = (PrettyField f <+> PutStr ":=") <+> PrettyFieldValue t v | |
PrettyField (LabelF l f) = l <:> PrettyField f |
type family PrettyFieldType (t :: BitField (rt :: Type) (st :: Type) (size :: Nat)) :: PrettyType where ... Source #
PrettyFieldType MkFieldFlag = PutStr "boolean" | |
PrettyFieldType (MkFieldBits :: BitField (B (s :: Nat)) Nat s) = PutStr "bits" <++> PrettyParens (PutNat s) | |
PrettyFieldType (MkFieldBitsXXL :: BitField Integer Nat (s :: Nat)) = PutStr "bits-XXL" <++> PrettyParens (PutNat s) | |
PrettyFieldType MkFieldU64 = PutStr "U64" | |
PrettyFieldType MkFieldU32 = PutStr "U32" | |
PrettyFieldType MkFieldU16 = PutStr "U16" | |
PrettyFieldType MkFieldU8 = PutStr "U8" | |
PrettyFieldType MkFieldI64 = PutStr "I64" | |
PrettyFieldType MkFieldI32 = PutStr "I32" | |
PrettyFieldType MkFieldI16 = PutStr "I16" | |
PrettyFieldType MkFieldI8 = PutStr "I8" | |
PrettyFieldType (MkFieldCustom :: BitField rt ct size) = ToPretty rt <++> PrettyParens (PutNat size) |
type family PrettyFieldValue (t :: BitField (rt :: Type) (st :: Type) (size :: Nat)) (v :: st) :: PrettyType where ... Source #
type family PrettyCustomFieldValue (rt :: Type) (st :: Type) (size :: Nat) (v :: st) :: PrettyType Source #
Instances
type PrettyCustomFieldValue ASizedString ASizedString s (sr :: ASizedString) Source # | |
Defined in Data.Type.BitRecords.SizedString | |
type PrettyCustomFieldValue (EnumValue e) e size (v :: e) Source # | |
type family PrintHexIfPossible t (s :: Nat) :: PrettyType where ... Source #
PrintHexIfPossible Word64 s = PutHex64 s | |
PrintHexIfPossible Word32 s = PutHex32 s | |
PrintHexIfPossible Word16 s = PutHex16 s | |
PrintHexIfPossible Word8 s = PutHex8 s | |
PrintHexIfPossible x s = TypeError (Text "Invalid size field type: " :<>: ShowType x) |