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

Binrep.CBLen

Synopsis

Documentation

class IsCBLen a Source #

Associated Types

type CBLen a :: Natural Source #

Instances

Instances details
IsCBLen Int16 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Int16 :: Natural Source #

IsCBLen Int32 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Int32 :: Natural Source #

IsCBLen Int64 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Int64 :: Natural Source #

IsCBLen Int8 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Int8 :: Natural Source #

IsCBLen Word16 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Word16 :: Natural Source #

IsCBLen Word32 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Word32 :: Natural Source #

IsCBLen Word64 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Word64 :: Natural Source #

IsCBLen Word8 Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen Word8 :: Natural Source #

IsCBLen DMagic Source # 
Instance details

Defined in Binrep.Test

Associated Types

type CBLen DMagic :: Natural Source #

IsCBLen () Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen () :: Natural Source #

IsCBLen (Magic a :: Type) Source #

The byte length of a magic is known at compile time.

Instance details

Defined in Binrep.Type.Magic

Associated Types

type CBLen (Magic a) :: Natural Source #

IsCBLen (NullPadded n a :: Type) Source # 
Instance details

Defined in Binrep.Type.NullPadded

Associated Types

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

IsCBLen (SizePrefixed pfx a :: Type) Source # 
Instance details

Defined in Binrep.Type.Prefix.Size

Associated Types

type CBLen (SizePrefixed pfx a) :: Natural Source #

IsCBLen (Sized n a :: Type) Source # 
Instance details

Defined in Binrep.Type.Sized

Associated Types

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

IsCBLen a => IsCBLen (ByteOrdered end a :: Type) Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen (ByteOrdered end a) :: Natural Source #

(IsCBLen l, IsCBLen r) => IsCBLen ((l, r) :: Type) Source # 
Instance details

Defined in Binrep.CBLen

Associated Types

type CBLen (l, r) :: Natural Source #

IsCBLen (CountPrefixed pfx f a :: Type) Source #

We can know byte length at compile time _if_ we know it for the prefix and the list-like.

This is extremely unlikely, because then what counting are we even performing for the list-like? But it's a valid instance.

Instance details

Defined in Binrep.Type.Prefix.Count

Associated Types

type CBLen (CountPrefixed pfx f a) :: Natural Source #

cblen :: forall a. KnownNat (CBLen a) => Int Source #

Reify a type's constant byte length to the term level.

cblen# :: forall a. KnownNat (CBLen a) => Int# Source #

cblenProxy# :: forall a. KnownNat (CBLen a) => Proxy# a -> Int# Source #