binrep-0.2.0: Encode precise binary representations directly in types
Safe HaskellSafe-Inferred
LanguageHaskell2010

Binrep.Generic.Get

Documentation

getGeneric :: (Generic a, GGet (Rep a), Get w, Eq w, Show w) => Cfg w -> Parser String a Source #

class GGet f where Source #

Methods

gget :: (Get w, Eq w, Show w) => Cfg w -> Parser String (f a) Source #

Instances

Instances details
GGet (U1 :: k -> Type) Source #

Empty constructor.

Instance details

Defined in Binrep.Generic.Get

Methods

gget :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> Parser String (U1 a) Source #

(TypeError GErrRefuseVoid :: Constraint) => GGet (V1 :: k -> Type) Source #

Refuse to derive instance for void datatype.

Instance details

Defined in Binrep.Generic.Get

Methods

gget :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> Parser String (V1 a) Source #

(GGet l, GGet r) => GGet (l :*: r :: k -> Type) Source #

Product type fields are consecutive.

Instance details

Defined in Binrep.Generic.Get

Methods

gget :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> Parser String ((l :*: r) a) Source #

GGetSum (l :+: r) => GGet (l :+: r :: k -> Type) Source #

Constructor sums are differentiated by a prefix tag.

Instance details

Defined in Binrep.Generic.Get

Methods

gget :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> Parser String ((l :+: r) a) Source #

Get c => GGet (K1 i c :: k -> Type) Source #

Field.

Instance details

Defined in Binrep.Generic.Get

Methods

gget :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> Parser String (K1 i c a) Source #

GGet f => GGet (M1 i d f :: k -> Type) Source #

Any datatype, constructor or record.

Instance details

Defined in Binrep.Generic.Get

Methods

gget :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> Parser String (M1 i d f a) Source #

class GGetSum f where Source #

Methods

ggetsum :: (Get w, Eq w, Show w) => Cfg w -> w -> Maybe (Parser String (f a)) Source #

Instances

Instances details
(GGetSum l, GGetSum r) => GGetSum (l :+: r :: k -> Type) Source # 
Instance details

Defined in Binrep.Generic.Get

Methods

ggetsum :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> w -> Maybe (Parser String ((l :+: r) a)) Source #

(GGet r, Constructor c) => GGetSum (C1 c r :: k -> Type) Source #

Bad. Need to wrap this like SumFromString in Aeson.

Instance details

Defined in Binrep.Generic.Get

Methods

ggetsum :: forall w (a :: k0). (Get w, Eq w, Show w) => Cfg w -> w -> Maybe (Parser String (C1 c r a)) Source #