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

Copyright (C) 2018 Csongor Kiss BSD3 Csongor Kiss experimental non-portable None Haskell2010

Data.Generics.Internal.VL.Iso

Description

Internal lens helpers. Only exported for Haddock

Synopsis

# Documentation

data Exchange a b s t Source #

Constructors

 Exchange (s -> a) (b -> t)
Instances
 Profunctor (Exchange a b) Source # Instance detailsDefined in Data.Generics.Internal.VL.Iso Methodsdimap :: (a0 -> b0) -> (c -> d) -> Exchange a b b0 c -> Exchange a b a0 d #lmap :: (a0 -> b0) -> Exchange a b b0 c -> Exchange a b a0 c #rmap :: (b0 -> c) -> Exchange a b a0 b0 -> Exchange a b a0 c #(#.) :: Coercible c b0 => q b0 c -> Exchange a b a0 b0 -> Exchange a b a0 c #(.#) :: Coercible b0 a0 => Exchange a b b0 c -> q a0 b0 -> Exchange a b a0 c # Functor (Exchange a b s) Source # Instance detailsDefined in Data.Generics.Internal.VL.Iso Methodsfmap :: (a0 -> b0) -> Exchange a b s a0 -> Exchange a b s b0 #(<\$) :: a0 -> Exchange a b s b0 -> Exchange a b s a0 #

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

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

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

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

Extract the two functions, one from s -> a and one from b -> t that characterize an Iso.

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

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 #

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

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