generic-lens-core-2.2.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.GenericLens.Internal

Description

The library internals are exposed through this module. Please keep in mind that everything here is subject to change irrespective of the the version numbers.

Synopsis

Documentation

data family Param :: Nat -> j -> k Source #

Instances

Instances details
newtype Param n (a :: Type) Source # 
Instance details

Defined in Data.Generics.Internal.GenericN

newtype Param n (a :: Type) = StarParam {}

newtype Rec (p :: Type) a x Source #

Constructors

Rec 

Fields

class (Coercible (Rep a) (RepN a), Generic a) => GenericN (a :: Type) where Source #

Associated Types

type RepN (a :: Type) :: Type -> Type Source #

type RepN a = Rep (Indexed a 0)

Methods

toN :: RepN a x -> a Source #

fromN :: a -> RepN a x Source #

Instances

Instances details
(Coercible (Rep a) (RepN a), Generic a) => GenericN a Source # 
Instance details

Defined in Data.Generics.Internal.GenericN

Associated Types

type RepN a :: Type -> Type Source #

Methods

toN :: RepN a x -> a Source #

fromN :: a -> RepN a x Source #

Profunctor optics

type Iso s t a b = forall p i. Profunctor p => p i a b -> p i s t Source #

type Iso' s a = Iso s s a a Source #

repIso :: (Generic a, Generic b) => Iso a b (Rep a x) (Rep b x) Source #

A type and its generic representation are isomorphic

mIso :: Iso (M1 i c f p) (M1 i c g p) (f p) (g p) Source #

M1 is just a wrapper around `f p` mIso :: Iso' (M1 i c f p) (f p)

kIso :: Iso (K1 r a p) (K1 r b p) a b Source #

recIso :: Iso (Rec r a p) (Rec r b p) a b Source #

sumIso :: Iso ((a :+: b) x) ((a' :+: b') x) (Either (a x) (b x)) (Either (a' x) (b' x)) Source #

prodIso :: Iso ((a :*: b) x) ((a' :*: b') x) (a x, b x) (a' x, b' x) Source #

assoc3 :: Iso ((a, b), c) ((a', b'), c') (a, (b, c)) (a', (b', c')) Source #

fromIso :: Iso s t a b -> Iso b a t s Source #

iso :: (s -> a) -> (b -> t) -> Iso s t a b Source #

withIso :: Iso s t a b -> ((s -> a) -> (b -> t) -> r) -> r Source #

pairing :: Iso s t a b -> Iso s' t' a' b' -> Iso (s, s') (t, t') (a, a') (b, b') Source #

type Lens s t a b = forall p i. Strong p => p i a b -> p i s t Source #

type LensLike p s t a b = p a b -> p s t Source #

ravel :: (ALens a b i a b -> ALens a b i s t) -> Lens s t a b Source #

set :: ((a -> b) -> s -> t) -> (s, b) -> t Source #

Setting

view :: Lens s s a a -> s -> a Source #

withLensPrim :: Lens s t a b -> (forall c. (s -> (c, a)) -> ((c, b) -> t) -> r) -> r Source #

idLens :: ALens a b i a b Source #

first :: Lens ((a :*: b) x) ((a' :*: b) x) (a x) (a' x) Source #

Lens focusing on the first element of a product

second :: Lens ((a :*: b) x) ((a :*: b') x) (b x) (b' x) Source #

Lens focusing on the second element of a product

fork :: (a -> b) -> (a -> c) -> a -> (b, c) Source #

data Coyoneda f b Source #

Constructors

forall a. Coyoneda (a -> b) (f a) 

Instances

Instances details
Functor (Coyoneda f) Source # 
Instance details

Defined in Data.Generics.Internal.Profunctor.Lens

Methods

fmap :: (a -> b) -> Coyoneda f a -> Coyoneda f b #

(<$) :: a -> Coyoneda f b -> Coyoneda f a #

inj :: Functor f => Coyoneda f a -> f a Source #

proj :: Functor f => f a -> Coyoneda f a Source #

(??) :: Functor f => f (a -> b) -> a -> f b Source #

assoc3L :: Lens ((a, b), c) ((a', b'), c') (a, (b, c)) (a', (b', c')) Source #

stron :: (Either s s', b) -> Either (s, b) (s', b) Source #

choosing :: forall s t a b s' t'. Lens s t a b -> Lens s' t' a b -> Lens (Either s s') (Either t t') a b Source #

lens :: (s -> (c, a)) -> ((c, b) -> t) -> Lens s t a b Source #

data ALens a b i s t Source #

Constructors

forall c. ALens (s -> (c, a)) ((c, b) -> t) 

Instances

Instances details
Profunctor (ALens a b) Source # 
Instance details

Defined in Data.Generics.Internal.Profunctor.Lens

Methods

dimap :: (a0 -> b0) -> (c -> d) -> ALens a b i b0 c -> ALens a b i a0 d #

lmap :: (a0 -> b0) -> ALens a b i b0 c -> ALens a b i a0 c #

rmap :: (c -> d) -> ALens a b i b0 c -> ALens a b i b0 d #

lcoerce' :: Coercible a0 b0 => ALens a b i a0 c -> ALens a b i b0 c #

rcoerce' :: Coercible a0 b0 => ALens a b i c a0 -> ALens a b i c b0 #

conjoined__ :: (ALens a b i a0 b0 -> ALens a b i s t) -> (ALens a b i a0 b0 -> ALens a b j s t) -> ALens a b i a0 b0 -> ALens a b j s t #

ixcontramap :: (j -> i) -> ALens a b i a0 b0 -> ALens a b j a0 b0 #

Strong (ALens a b) Source # 
Instance details

Defined in Data.Generics.Internal.Profunctor.Lens

Methods

first' :: ALens a b i a0 b0 -> ALens a b i (a0, c) (b0, c) #

second' :: ALens a b i a0 b0 -> ALens a b i (c, a0) (c, b0) #

linear :: (forall (f :: Type -> Type). Functor f => (a0 -> f b0) -> s -> f t) -> ALens a b i a0 b0 -> ALens a b i s t #

ilinear :: (forall (f :: Type -> Type). Functor f => (i -> a0 -> f b0) -> s -> f t) -> ALens a b j a0 b0 -> ALens a b (i -> j) s t #

Functor (ALens a b i s) Source # 
Instance details

Defined in Data.Generics.Internal.Profunctor.Lens

Methods

fmap :: (a0 -> b0) -> ALens a b i s a0 -> ALens a b i s b0 #

(<$) :: a0 -> ALens a b i s b0 -> ALens a b i s a0 #

swap :: (a, b) -> (b, a) Source #

type APrism i s t a b = Market a b i a b -> Market a b i s t Source #

type Prism s t a b = forall p i. Choice p => p i a b -> p i s t Source #

type Prism' s a = forall p i. Choice p => p i a a -> p i s s Source #

left :: Prism ((a :+: c) x) ((b :+: c) x) (a x) (b x) Source #

right :: Prism ((a :+: b) x) ((a :+: c) x) (b x) (c x) Source #

prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b Source #

_Left :: Prism (Either a c) (Either b c) a b Source #

_Right :: Prism (Either c a) (Either c b) a b Source #

prismPRavel :: APrism i s t a b -> Prism s t a b Source #

build :: (Tagged i b b -> Tagged i t t) -> b -> t Source #

match :: Prism s t a b -> s -> Either t a Source #

without' :: Prism s t a b -> Prism s t c d -> Prism s t (Either a c) (Either b d) Source #

withPrism :: APrism i s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r Source #

prism2prismp :: Market a b i s t -> Prism s t a b Source #

idPrism :: Market a b i a b Source #

gsum :: (a x -> c) -> (b x -> c) -> (a :+: b) x -> c Source #