generic-lens-1.0.0.0: Generically derive traversals, lenses and prisms.

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

Data.Generics.Internal.Profunctor.Iso

Description

Internal lens helpers. Only exported for Haddock

Synopsis

Documentation

type Iso s t a b = forall p. Profunctor p => p a b -> p 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 #

data Exchange a b s t Source #

Constructors

Exchange (s -> a) (b -> t) 

Instances

Profunctor (Exchange a b) Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> Exchange a b b c -> Exchange a b a d #

lmap :: (a -> b) -> Exchange a b b c -> Exchange a b a c #

rmap :: (b -> c) -> Exchange a b a b -> Exchange a b a c #

(#.) :: Coercible * c b => (b -> c) -> Exchange a b a b -> Exchange a b a c #

(.#) :: Coercible * b a => Exchange a b b c -> (a -> b) -> Exchange a b a c #

Functor (Exchange a b s) Source # 

Methods

fmap :: (a -> b) -> Exchange a b s a -> Exchange a b s b #

(<$) :: a -> Exchange a b s b -> Exchange a b s a #