generic-lens-0.3.0.1: 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`

kIso :: Iso' (K1 t a x) a Source #

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