generic-lens-core-2.1.0.0: Generically derive traversals, lenses and prisms.
Copyright(C) 2020 Csongor Kiss
LicenseBSD3
MaintainerCsongor Kiss <kiss.csongor.kiss@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Generics.Sum.Internal.Constructors

Description

Derive constructor-name-based prisms generically.

Synopsis

Documentation

class GAsConstructor (ctor :: Symbol) s t a b | ctor s -> a, ctor t -> b where Source #

As AsConstructor but over generic representations as defined by GHC.Generics.

Methods

_GCtor :: Prism (s x) (t x) a b Source #

Instances

Instances details
GSumAsConstructor ctor (HasCtorP ctor l) l r l' r' a b => GAsConstructor ctor (l :+: r) (l' :+: r') a b Source # 
Instance details

Defined in Data.Generics.Sum.Internal.Constructors

Methods

_GCtor :: Prism ((l :+: r) x) ((l' :+: r') x) a b Source #

GAsConstructor ctor f f' a b => GAsConstructor ctor (M1 D meta f) (M1 D meta f') a b Source # 
Instance details

Defined in Data.Generics.Sum.Internal.Constructors

Methods

_GCtor :: Prism (M1 D meta f x) (M1 D meta f' x) a b Source #

(GIsList f g as bs, ListTuple a b as bs) => GAsConstructor ctor (M1 C ('MetaCons ctor fixity fields) f) (M1 C ('MetaCons ctor fixity fields) g) a b Source # 
Instance details

Defined in Data.Generics.Sum.Internal.Constructors

Methods

_GCtor :: Prism (M1 C ('MetaCons ctor fixity fields) f x) (M1 C ('MetaCons ctor fixity fields) g x) a b Source #

type GAsConstructor' ctor s a = GAsConstructor ctor s s a a Source #

type Context' ctor s a = (Context0 ctor s s a a, ErrorUnless ctor s (HasCtorP ctor (Rep s))) Source #

class Context (ctor :: Symbol) s t a b | ctor s -> a, ctor t -> b Source #

Instances

Instances details
(ErrorUnless ctor s (HasCtorP ctor (Rep s)), GAsConstructor' ctor (Rep s) a, GAsConstructor' ctor (Rep (Indexed s)) a', GAsConstructor ctor (Rep s) (Rep t) a b, t ~ Infer s a' b, GAsConstructor' ctor (Rep (Indexed t)) b', s ~ Infer t b' a) => Context ctor s t a b Source # 
Instance details

Defined in Data.Generics.Sum.Internal.Constructors

class Context_ (ctor :: Symbol) s t a b Source #

Instances

Instances details
(ErrorUnless ctor s (HasCtorP ctor (Rep s)), GAsConstructor' ctor (Rep s) a, GAsConstructor' ctor (Rep (Indexed s)) a', GAsConstructor ctor (Rep s) (Rep t) a b, GAsConstructor' ctor (Rep (Indexed t)) b', UnifyHead s t, UnifyHead t s) => Context_ ctor s t a b Source # 
Instance details

Defined in Data.Generics.Sum.Internal.Constructors

type Context0 ctor s t a b = (Generic s, Generic t, GAsConstructor ctor (Rep s) (Rep t) a b, Defined (Rep s) (NoGeneric s '[(('Text "arising from a generic prism focusing on the " :<>: QuoteType ctor) :<>: 'Text " constructor of type ") :<>: QuoteType a, 'Text "in " :<>: QuoteType s]) (() :: Constraint)) Source #

derived0 :: forall ctor s t a b. Context0 ctor s t a b => Prism s t a b Source #