generic-lens-0.4.1.0: Generic data-structure operations exposed as lenses.

Copyright(C) 2017 Csongor Kiss
LicenseBSD3
MaintainerCsongor Kiss <kiss.csongor.kiss@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Generics.Internal.Lens

Description

Internal lens helpers. Only exported for Haddock

Synopsis

Documentation

type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s Source #

Type alias for lens

type Prism' s a = forall p f. (Choice p, Applicative f) => p a (f a) -> p s (f s) Source #

Type alias for prism

type Iso' s a = forall p f. (Profunctor p, Functor f) => p a (f a) -> p s (f s) Source #

(^.) :: s -> ((a -> Const a a) -> s -> Const a s) -> a infixl 8 Source #

Getting

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

Setting

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

Lens focusing on the first element of a product

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

Lens focusing on the second element of a product

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

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

combine :: Lens' (s x) a -> Lens' (t x) a -> Lens' ((s :+: t) x) a Source #

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

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

A type and its generic representation are isomorphic

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

M1 is just a wrapper around `f p`

mLens :: Lens' (M1 i c f p) (f p) Source #

repLens :: Generic a => Lens' a (Rep a x) Source #

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

data Coyoneda f b Source #

Constructors

Coyoneda (a -> b) (f a) 

Instances

Functor (Coyoneda f) Source # 

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 #

ravel :: Functor f => ((a -> Coyoneda f b) -> s -> Coyoneda f t) -> (a -> f b) -> s -> f t Source #