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

Binrep.Type.Sized

Description

Constant-size data.

Synopsis

Documentation

data Size (n :: Natural) Source #

Essentially runtime reflection of a BLen type to CBLen.

Instances

Instances details
Predicate (Size n :: Type) Source # 
Instance details

Defined in Binrep.Type.Sized

(KnownPredicateName (Size n), BLen a, KnownNat n) => Refine (Size n :: Type) a Source # 
Instance details

Defined in Binrep.Type.Sized

Methods

validate :: Proxy# (Size n) -> a -> Maybe RefineFailure #

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

Defined in Binrep.Type.Sized

Associated Types

type CBLen (Sized n a :: Type) 
Instance details

Defined in Binrep.Type.Sized

type CBLen (Sized n a :: Type) = n
KnownNat n => BLen (Sized n a) Source # 
Instance details

Defined in Binrep.Type.Sized

Methods

blen :: Sized n a -> Int Source #

(Get a, KnownNat n) => Get (Sized n a) Source # 
Instance details

Defined in Binrep.Type.Sized

Methods

get :: Getter (Sized n a) Source #

Put a => Put (Sized n a) Source # 
Instance details

Defined in Binrep.Type.Sized

Methods

put :: Sized n a -> Putter Source #

PutC a => PutC (Sized n a) Source # 
Instance details

Defined in Binrep.Type.Sized

Methods

putC :: Sized n a -> PutterC Source #

type PredicateName d (Size n :: Type) Source # 
Instance details

Defined in Binrep.Type.Sized

type PredicateName d (Size n :: Type) = ShowParen (d > 9) ("Size " ++ ShowNatDec n)
type CBLen (Sized n a :: Type) Source # 
Instance details

Defined in Binrep.Type.Sized

type CBLen (Sized n a :: Type) = n

type Sized (n :: Natural) = Refined (Size n) Source #