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

Binrep.Type.Sized

Description

Constant-size data.

Synopsis

Documentation

data Size (n :: Natural) Source #

Essentially reflects a BLen type to CBLen.

Instances

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

Defined in Binrep.Type.Sized

Methods

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

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

Defined in Binrep.Type.Sized

Associated Types

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

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 -> Poke Source #

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

Defined in Binrep.Type.Sized

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

type Sized n = Refined (Size n) Source #