generic-data-functions-0.5.1: Familiar functions lifted to generic data types
Safe HaskellSafe-Inferred
LanguageGHC2021

Generic.Data.Function.Contra

Synopsis

Documentation

class GenericContra tag where Source #

TODO

The type variable is uninstantiated, used purely as a tag. Good types include the type class used inside (providing you define the type class/it's not an orphan instance), or a custom void data type. See the binrep library on Hackage for an example.

Associated Types

type GenericContraF tag :: Type -> Type Source #

type GenericContraC tag a :: Constraint Source #

Instances

Instances details
GenericContra (EmptyRec0 f :: Type) Source #

over types where all fields map to mempty

Instance details

Defined in Generic.Data.Function.Contra.Constructor

Associated Types

type GenericContraF (EmptyRec0 f) :: Type -> Type Source #

type GenericContraC (EmptyRec0 f) a Source #

GenericContra (NoRec0 f :: Type) Source #

over types with no fields in any constructor

Instance details

Defined in Generic.Data.Function.Contra.Constructor

Associated Types

type GenericContraF (NoRec0 f) :: Type -> Type Source #

type GenericContraC (NoRec0 f) a Source #

genericContraNonSum :: forall {k} (tag :: k) a. (Generic a, Contravariant (GenericContraF tag), GContraNonSum tag (Rep a)) => GenericContraF tag a Source #

Generic contra over a term of non-sum data type a.

a must have exactly one constructor.

class GContraNonSum tag gf Source #

Minimal complete definition

gContraNonSum

Instances

Instances details
(Contravariant (GenericContraF tag), GContraNonSumD tag gf) => GContraNonSum (tag :: k1) (C1 c gf :: k2 -> Type) Source # 
Instance details

Defined in Generic.Data.Function.Contra.NonSum

Methods

gContraNonSum :: forall (p :: k10). GenericContraF tag (C1 c gf p) Source #

genericContraSum :: forall {k} (tag :: k) a. (Generic a, Contravariant (GenericContraF tag), GContraSum tag (Rep a)) => GenericContraF tag String -> GenericContraF tag a Source #

Generic contra over a term of sum data type a.

You must provide a contra function for constructor names.

This is the most generic option, but depending on your string manipulation may be slower.

class GContraSum tag gf Source #

Minimal complete definition

gContraSum

Instances

Instances details
(GContraSumD tag gf, Contravariant (GenericContraF tag)) => GContraSum (tag :: k1) (D1 cd gf :: k2 -> Type) Source # 
Instance details

Defined in Generic.Data.Function.Contra.Sum

Methods

gContraSum :: forall (p :: k10). GenericContraF tag String -> GenericContraF tag (D1 cd gf p) Source #