definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments

Safe HaskellNone
LanguageHaskell2010

Algebra.Lens

Contents

Description

A module providing simple Lens functionality.

Lenses are a Haskell abstraction that allows you to access and modify part of a structure, compensating for and improving upon Haskell's horrendous record syntax and giving Haskell a first-class record system.

This module defines four kinds of Lenses : Folds that allow multiple readwrites into a structure; Traversals that allow parallel readwrites; Lenses that allow just a single read/write; and Isos which allow a read and a write in both directions. Lenses of any kind can be composed with (.), yielding a Lens of the most general kind, so that composing a Lens with an Iso yields a Lens, and a Traversal with an Iso or a Lens yields a Traversal.

Synopsis

The lens types

type LensLike f s t a b = (s -> f t) -> a -> f b Source #

type FixFold s t a b = forall m. MonadFix m => LensLike m s t a b Source #

type FixFold' a b = Simple FixFold a b Source #

type Fold s t a b = forall m. Monad m => LensLike m s t a b Source #

type Fold' a b = Simple Fold a b Source #

type Traversal s t a b = forall f. Applicative f => LensLike f s t a b Source #

type Traversal' a b = Simple Traversal a b Source #

type Lens s t a b = forall f. Functor f => LensLike f s t a b Source #

type Lens' a b = Simple Lens a b Source #

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

type Iso' a b = Simple Iso a b Source #

type (:<->:) a b = Iso' a b Source #

Constructing lenses

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

Create an Iso from two inverse functions.

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

Reverse an Iso

from :: Iso' a b -> Iso' b a

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

Create a Lens from a getter and setter function.

lens :: (a -> b) -> (a -> b -> a) -> Lens' a b

getter :: (a -> b) -> Lens' a b Source #

prism :: (a -> b :+: s) -> (a -> t -> b) -> Traversal s t a b Source #

Create a Traversal from a maybe getter and setter function.

prism :: (a -> (a:+:b)) -> (a -> b -> a) -> Traversal' a b

sat :: (a -> Bool) -> Traversal' a a Source #

simple :: LensLike f a b a b -> LensLike f a b a b Source #

(.+) :: Monad m => LensLike m s t a b -> LensLike m s t b c -> LensLike m s t a c infixr 8 Source #

forl :: LensLike f a b c d -> c -> (a -> f b) -> f d Source #

forl_ :: Functor f => LensLike f a a c c -> c -> (a -> f ()) -> f () Source #

traversel :: LensLike f a b c d -> (a -> f b) -> c -> f d Source #

traversel_ :: Functor f => LensLike f a a c c -> (a -> f ()) -> c -> f () Source #

Extracting values

(^.) :: a -> Lens b b a a -> b infixl 8 Source #

Retrieve a value from a structure using a Lens (or Iso)

($^) :: Lens b b a a -> a -> b infixr 0 Source #

(^..) :: a -> Iso a a b b -> b infixl 8 Source #

(^?) :: (Unit f, Monoid (f b), MonadFix ((,) (f b))) => a -> FixFold' a b -> f b infixl 8 Source #

has :: MonadFix ((,) Bool) => FixFold' a b -> a -> Bool Source #

(^??) :: MonadFix ((,) [b]) => a -> FixFold' a b -> [b] infixl 8 Source #

(%~) :: FixFold s t a b -> (s -> t) -> a -> b infixl 8 Source #

(%-) :: FixFold s t a b -> t -> a -> b infixl 8 Source #

(%%~) :: Iso s t a b -> (b -> a) -> t -> s infixl 8 Source #

(%%-) :: Iso s t a b -> a -> t -> s infixl 8 Source #

by :: Lens b u a v -> a -> b Source #

yb :: Iso s t a b -> t -> b infixr 8 Source #

warp :: FixFold s t a b -> (s -> t) -> a -> b Source #

set :: FixFold s t a b -> t -> a -> b Source #

(-.) :: Lens c u b v -> (a -> b) -> a -> c infixr 9 Source #

(.-) :: (b -> c) -> Iso a a b b -> a -> c infixr 9 Source #

interpret :: Iso' (r -> a) b -> r -> b -> a Source #

Basic lenses

class Lens1 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'1

Methods

l'1 :: Lens s t a b Source #

Instances

Lens1 a a [a] [a] Source # 

Methods

l'1 :: Lens a a [a] [a] Source #

Lens1 x y (Tuple2 x a) (Tuple2 y a) Source # 

Methods

l'1 :: Lens x y (Tuple2 x a) (Tuple2 y a) Source #

Lens1 a b (Assoc a c) (Assoc b c) Source # 

Methods

l'1 :: Lens a b (Assoc a c) (Assoc b c) Source #

Lens1 a a (Cofree f a) (Cofree f a) Source # 

Methods

l'1 :: Lens a a (Cofree f a) (Cofree f a) Source #

Lens1 x y (Tuple3 x a b) (Tuple3 y a b) Source # 

Methods

l'1 :: Lens x y (Tuple3 x a b) (Tuple3 y a b) Source #

Lens1 x y (Tuple4 x a b c) (Tuple4 y a b c) Source # 

Methods

l'1 :: Lens x y (Tuple4 x a b c) (Tuple4 y a b c) Source #

Lens1 x y (Tuple5 x a b c d) (Tuple5 y a b c d) Source # 

Methods

l'1 :: Lens x y (Tuple5 x a b c d) (Tuple5 y a b c d) Source #

Lens1 x y (Tuple6 x a b c d e) (Tuple6 y a b c d e) Source # 

Methods

l'1 :: Lens x y (Tuple6 x a b c d e) (Tuple6 y a b c d e) Source #

Lens1 x y (Tuple7 x a b c d e f) (Tuple7 y a b c d e f) Source # 

Methods

l'1 :: Lens x y (Tuple7 x a b c d e f) (Tuple7 y a b c d e f) Source #

Lens1 x y (Tuple8 x a b c d e f g) (Tuple8 y a b c d e f g) Source # 

Methods

l'1 :: Lens x y (Tuple8 x a b c d e f g) (Tuple8 y a b c d e f g) Source #

Lens1 x y (Tuple9 x a b c d e f g h) (Tuple9 y a b c d e f g h) Source # 

Methods

l'1 :: Lens x y (Tuple9 x a b c d e f g h) (Tuple9 y a b c d e f g h) Source #

class Lens2 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'2

Methods

l'2 :: Lens s t a b Source #

Instances

Lens2 x y (Tuple2 a x) (Tuple2 a y) Source # 

Methods

l'2 :: Lens x y (Tuple2 a x) (Tuple2 a y) Source #

Lens2 a b (Assoc c a) (Assoc c b) Source # 

Methods

l'2 :: Lens a b (Assoc c a) (Assoc c b) Source #

Lens2 x y (Tuple3 a x b) (Tuple3 a y b) Source # 

Methods

l'2 :: Lens x y (Tuple3 a x b) (Tuple3 a y b) Source #

Lens2 x y (Tuple4 a x b c) (Tuple4 a y b c) Source # 

Methods

l'2 :: Lens x y (Tuple4 a x b c) (Tuple4 a y b c) Source #

Lens2 x y (Tuple5 a x b c d) (Tuple5 a y b c d) Source # 

Methods

l'2 :: Lens x y (Tuple5 a x b c d) (Tuple5 a y b c d) Source #

Lens2 x y (Tuple6 a x b c d e) (Tuple6 a y b c d e) Source # 

Methods

l'2 :: Lens x y (Tuple6 a x b c d e) (Tuple6 a y b c d e) Source #

Lens2 x y (Tuple7 a x b c d e f) (Tuple7 a y b c d e f) Source # 

Methods

l'2 :: Lens x y (Tuple7 a x b c d e f) (Tuple7 a y b c d e f) Source #

Lens2 x y (Tuple8 a x b c d e f g) (Tuple8 a y b c d e f g) Source # 

Methods

l'2 :: Lens x y (Tuple8 a x b c d e f g) (Tuple8 a y b c d e f g) Source #

Lens2 x y (Tuple9 a x b c d e f g h) (Tuple9 a y b c d e f g h) Source # 

Methods

l'2 :: Lens x y (Tuple9 a x b c d e f g h) (Tuple9 a y b c d e f g h) Source #

Lens2 (f (Cofree f a)) (f (Cofree f a)) (Cofree f a) (Cofree f a) Source # 

Methods

l'2 :: Lens (f (Cofree f a)) (f (Cofree f a)) (Cofree f a) (Cofree f a) Source #

class Lens3 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'3

Methods

l'3 :: Lens s t a b Source #

Instances

Lens3 x y (Tuple3 a b x) (Tuple3 a b y) Source # 

Methods

l'3 :: Lens x y (Tuple3 a b x) (Tuple3 a b y) Source #

Lens3 x y (Tuple4 a b x c) (Tuple4 a b y c) Source # 

Methods

l'3 :: Lens x y (Tuple4 a b x c) (Tuple4 a b y c) Source #

Lens3 x y (Tuple5 a b x c d) (Tuple5 a b y c d) Source # 

Methods

l'3 :: Lens x y (Tuple5 a b x c d) (Tuple5 a b y c d) Source #

Lens3 x y (Tuple6 a b x c d e) (Tuple6 a b y c d e) Source # 

Methods

l'3 :: Lens x y (Tuple6 a b x c d e) (Tuple6 a b y c d e) Source #

Lens3 x y (Tuple7 a b x c d e f) (Tuple7 a b y c d e f) Source # 

Methods

l'3 :: Lens x y (Tuple7 a b x c d e f) (Tuple7 a b y c d e f) Source #

Lens3 x y (Tuple8 a b x c d e f g) (Tuple8 a b y c d e f g) Source # 

Methods

l'3 :: Lens x y (Tuple8 a b x c d e f g) (Tuple8 a b y c d e f g) Source #

Lens3 x y (Tuple9 a b x c d e f g h) (Tuple9 a b y c d e f g h) Source # 

Methods

l'3 :: Lens x y (Tuple9 a b x c d e f g h) (Tuple9 a b y c d e f g h) Source #

class Lens4 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'4

Methods

l'4 :: Lens s t a b Source #

Instances

Lens4 x y (Tuple4 a b c x) (Tuple4 a b c y) Source # 

Methods

l'4 :: Lens x y (Tuple4 a b c x) (Tuple4 a b c y) Source #

Lens4 x y (Tuple5 a b c x d) (Tuple5 a b c y d) Source # 

Methods

l'4 :: Lens x y (Tuple5 a b c x d) (Tuple5 a b c y d) Source #

Lens4 x y (Tuple6 a b c x d e) (Tuple6 a b c y d e) Source # 

Methods

l'4 :: Lens x y (Tuple6 a b c x d e) (Tuple6 a b c y d e) Source #

Lens4 x y (Tuple7 a b c x d e f) (Tuple7 a b c y d e f) Source # 

Methods

l'4 :: Lens x y (Tuple7 a b c x d e f) (Tuple7 a b c y d e f) Source #

Lens4 x y (Tuple8 a b c x d e f g) (Tuple8 a b c y d e f g) Source # 

Methods

l'4 :: Lens x y (Tuple8 a b c x d e f g) (Tuple8 a b c y d e f g) Source #

Lens4 x y (Tuple9 a b c x d e f g h) (Tuple9 a b c y d e f g h) Source # 

Methods

l'4 :: Lens x y (Tuple9 a b c x d e f g h) (Tuple9 a b c y d e f g h) Source #

class Lens5 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'5

Methods

l'5 :: Lens s t a b Source #

Instances

Lens5 x y (Tuple5 a b c d x) (Tuple5 a b c d y) Source # 

Methods

l'5 :: Lens x y (Tuple5 a b c d x) (Tuple5 a b c d y) Source #

Lens5 x y (Tuple6 a b c d x e) (Tuple6 a b c d y e) Source # 

Methods

l'5 :: Lens x y (Tuple6 a b c d x e) (Tuple6 a b c d y e) Source #

Lens5 x y (Tuple7 a b c d x e f) (Tuple7 a b c d y e f) Source # 

Methods

l'5 :: Lens x y (Tuple7 a b c d x e f) (Tuple7 a b c d y e f) Source #

Lens5 x y (Tuple8 a b c d x e f g) (Tuple8 a b c d y e f g) Source # 

Methods

l'5 :: Lens x y (Tuple8 a b c d x e f g) (Tuple8 a b c d y e f g) Source #

Lens5 x y (Tuple9 a b c d x e f g h) (Tuple9 a b c d y e f g h) Source # 

Methods

l'5 :: Lens x y (Tuple9 a b c d x e f g h) (Tuple9 a b c d y e f g h) Source #

class Lens6 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'6

Methods

l'6 :: Lens s t a b Source #

Instances

Lens6 x y (Tuple6 a b c d e x) (Tuple6 a b c d e y) Source # 

Methods

l'6 :: Lens x y (Tuple6 a b c d e x) (Tuple6 a b c d e y) Source #

Lens6 x y (Tuple7 a b c d e x f) (Tuple7 a b c d e y f) Source # 

Methods

l'6 :: Lens x y (Tuple7 a b c d e x f) (Tuple7 a b c d e y f) Source #

Lens6 x y (Tuple8 a b c d e x f g) (Tuple8 a b c d e y f g) Source # 

Methods

l'6 :: Lens x y (Tuple8 a b c d e x f g) (Tuple8 a b c d e y f g) Source #

Lens6 x y (Tuple9 a b c d e x f g h) (Tuple9 a b c d e y f g h) Source # 

Methods

l'6 :: Lens x y (Tuple9 a b c d e x f g h) (Tuple9 a b c d e y f g h) Source #

class Lens7 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'7

Methods

l'7 :: Lens s t a b Source #

Instances

Lens7 x y (Tuple7 a b c d e f x) (Tuple7 a b c d e f y) Source # 

Methods

l'7 :: Lens x y (Tuple7 a b c d e f x) (Tuple7 a b c d e f y) Source #

Lens7 x y (Tuple8 a b c d e f x g) (Tuple8 a b c d e f y g) Source # 

Methods

l'7 :: Lens x y (Tuple8 a b c d e f x g) (Tuple8 a b c d e f y g) Source #

Lens7 x y (Tuple9 a b c d e f x g h) (Tuple9 a b c d e f y g h) Source # 

Methods

l'7 :: Lens x y (Tuple9 a b c d e f x g h) (Tuple9 a b c d e f y g h) Source #

class Lens8 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'8

Methods

l'8 :: Lens s t a b Source #

Instances

Lens8 x y (Tuple8 a b c d e f g x) (Tuple8 a b c d e f g y) Source # 

Methods

l'8 :: Lens x y (Tuple8 a b c d e f g x) (Tuple8 a b c d e f g y) Source #

Lens8 x y (Tuple9 a b c d e f g x h) (Tuple9 a b c d e f g y h) Source # 

Methods

l'8 :: Lens x y (Tuple9 a b c d e f g x h) (Tuple9 a b c d e f g y h) Source #

class Lens9 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

l'9

Methods

l'9 :: Lens s t a b Source #

Instances

Lens9 x y (Tuple9 a b c d e f g h x) (Tuple9 a b c d e f g h y) Source # 

Methods

l'9 :: Lens x y (Tuple9 a b c d e f g h x) (Tuple9 a b c d e f g h y) Source #

class Trav1 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'1

Methods

t'1 :: Traversal s t a b Source #

Instances

Trav1 a a [a] [a] Source # 

Methods

t'1 :: Traversal a a [a] [a] Source #

Trav1 a b ((:+:) a c) ((:+:) b c) Source # 

Methods

t'1 :: Traversal a b (a :+: c) (b :+: c) Source #

Trav1 x y (Union3 x a b) (Union3 y a b) Source # 

Methods

t'1 :: Traversal x y (Union3 x a b) (Union3 y a b) Source #

Trav1 x y (Union4 x a b c) (Union4 y a b c) Source # 

Methods

t'1 :: Traversal x y (Union4 x a b c) (Union4 y a b c) Source #

Trav1 x y (Union5 x a b c d) (Union5 y a b c d) Source # 

Methods

t'1 :: Traversal x y (Union5 x a b c d) (Union5 y a b c d) Source #

Trav1 x y (Union6 x a b c d e) (Union6 y a b c d e) Source # 

Methods

t'1 :: Traversal x y (Union6 x a b c d e) (Union6 y a b c d e) Source #

Trav1 x y (Union7 x a b c d e f) (Union7 y a b c d e f) Source # 

Methods

t'1 :: Traversal x y (Union7 x a b c d e f) (Union7 y a b c d e f) Source #

Trav1 x y (Union8 x a b c d e f g) (Union8 y a b c d e f g) Source # 

Methods

t'1 :: Traversal x y (Union8 x a b c d e f g) (Union8 y a b c d e f g) Source #

Trav1 x y (Union9 x a b c d e f g h) (Union9 y a b c d e f g h) Source # 

Methods

t'1 :: Traversal x y (Union9 x a b c d e f g h) (Union9 y a b c d e f g h) Source #

class Trav2 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'2

Methods

t'2 :: Traversal s t a b Source #

Instances

Trav2 a b (Maybe a) (Maybe b) Source # 

Methods

t'2 :: Traversal a b (Maybe a) (Maybe b) Source #

Trav2 a b ((:+:) c a) ((:+:) c b) Source # 

Methods

t'2 :: Traversal a b (c :+: a) (c :+: b) Source #

Trav2 x y (Union3 a x b) (Union3 a y b) Source # 

Methods

t'2 :: Traversal x y (Union3 a x b) (Union3 a y b) Source #

Trav2 x y (Union4 a x b c) (Union4 a y b c) Source # 

Methods

t'2 :: Traversal x y (Union4 a x b c) (Union4 a y b c) Source #

Trav2 x y (Union5 a x b c d) (Union5 a y b c d) Source # 

Methods

t'2 :: Traversal x y (Union5 a x b c d) (Union5 a y b c d) Source #

Trav2 x y (Union6 a x b c d e) (Union6 a y b c d e) Source # 

Methods

t'2 :: Traversal x y (Union6 a x b c d e) (Union6 a y b c d e) Source #

Trav2 x y (Union7 a x b c d e f) (Union7 a y b c d e f) Source # 

Methods

t'2 :: Traversal x y (Union7 a x b c d e f) (Union7 a y b c d e f) Source #

Trav2 x y (Union8 a x b c d e f g) (Union8 a y b c d e f g) Source # 

Methods

t'2 :: Traversal x y (Union8 a x b c d e f g) (Union8 a y b c d e f g) Source #

Trav2 x y (Union9 a x b c d e f g h) (Union9 a y b c d e f g h) Source # 

Methods

t'2 :: Traversal x y (Union9 a x b c d e f g h) (Union9 a y b c d e f g h) Source #

class Trav3 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'3

Methods

t'3 :: Traversal s t a b Source #

Instances

Trav3 x y (Union3 a b x) (Union3 a b y) Source # 

Methods

t'3 :: Traversal x y (Union3 a b x) (Union3 a b y) Source #

Trav3 x y (Union4 a b x c) (Union4 a b y c) Source # 

Methods

t'3 :: Traversal x y (Union4 a b x c) (Union4 a b y c) Source #

Trav3 x y (Union5 a b x c d) (Union5 a b y c d) Source # 

Methods

t'3 :: Traversal x y (Union5 a b x c d) (Union5 a b y c d) Source #

Trav3 x y (Union6 a b x c d e) (Union6 a b y c d e) Source # 

Methods

t'3 :: Traversal x y (Union6 a b x c d e) (Union6 a b y c d e) Source #

Trav3 x y (Union7 a b x c d e f) (Union7 a b y c d e f) Source # 

Methods

t'3 :: Traversal x y (Union7 a b x c d e f) (Union7 a b y c d e f) Source #

Trav3 x y (Union8 a b x c d e f g) (Union8 a b y c d e f g) Source # 

Methods

t'3 :: Traversal x y (Union8 a b x c d e f g) (Union8 a b y c d e f g) Source #

Trav3 x y (Union9 a b x c d e f g h) (Union9 a b y c d e f g h) Source # 

Methods

t'3 :: Traversal x y (Union9 a b x c d e f g h) (Union9 a b y c d e f g h) Source #

class Trav4 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'4

Methods

t'4 :: Traversal s t a b Source #

Instances

Trav4 x y (Union4 a b c x) (Union4 a b c y) Source # 

Methods

t'4 :: Traversal x y (Union4 a b c x) (Union4 a b c y) Source #

Trav4 x y (Union5 a b c x d) (Union5 a b c y d) Source # 

Methods

t'4 :: Traversal x y (Union5 a b c x d) (Union5 a b c y d) Source #

Trav4 x y (Union6 a b c x d e) (Union6 a b c y d e) Source # 

Methods

t'4 :: Traversal x y (Union6 a b c x d e) (Union6 a b c y d e) Source #

Trav4 x y (Union7 a b c x d e f) (Union7 a b c y d e f) Source # 

Methods

t'4 :: Traversal x y (Union7 a b c x d e f) (Union7 a b c y d e f) Source #

Trav4 x y (Union8 a b c x d e f g) (Union8 a b c y d e f g) Source # 

Methods

t'4 :: Traversal x y (Union8 a b c x d e f g) (Union8 a b c y d e f g) Source #

Trav4 x y (Union9 a b c x d e f g h) (Union9 a b c y d e f g h) Source # 

Methods

t'4 :: Traversal x y (Union9 a b c x d e f g h) (Union9 a b c y d e f g h) Source #

class Trav5 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'5

Methods

t'5 :: Traversal s t a b Source #

Instances

Trav5 x y (Union5 a b c d x) (Union5 a b c d y) Source # 

Methods

t'5 :: Traversal x y (Union5 a b c d x) (Union5 a b c d y) Source #

Trav5 x y (Union6 a b c d x e) (Union6 a b c d y e) Source # 

Methods

t'5 :: Traversal x y (Union6 a b c d x e) (Union6 a b c d y e) Source #

Trav5 x y (Union7 a b c d x e f) (Union7 a b c d y e f) Source # 

Methods

t'5 :: Traversal x y (Union7 a b c d x e f) (Union7 a b c d y e f) Source #

Trav5 x y (Union8 a b c d x e f g) (Union8 a b c d y e f g) Source # 

Methods

t'5 :: Traversal x y (Union8 a b c d x e f g) (Union8 a b c d y e f g) Source #

Trav5 x y (Union9 a b c d x e f g h) (Union9 a b c d y e f g h) Source # 

Methods

t'5 :: Traversal x y (Union9 a b c d x e f g h) (Union9 a b c d y e f g h) Source #

class Trav6 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'6

Methods

t'6 :: Traversal s t a b Source #

Instances

Trav6 x y (Union6 a b c d e x) (Union6 a b c d e y) Source # 

Methods

t'6 :: Traversal x y (Union6 a b c d e x) (Union6 a b c d e y) Source #

Trav6 x y (Union7 a b c d e x f) (Union7 a b c d e y f) Source # 

Methods

t'6 :: Traversal x y (Union7 a b c d e x f) (Union7 a b c d e y f) Source #

Trav6 x y (Union8 a b c d e x f g) (Union8 a b c d e y f g) Source # 

Methods

t'6 :: Traversal x y (Union8 a b c d e x f g) (Union8 a b c d e y f g) Source #

Trav6 x y (Union9 a b c d e x f g h) (Union9 a b c d e y f g h) Source # 

Methods

t'6 :: Traversal x y (Union9 a b c d e x f g h) (Union9 a b c d e y f g h) Source #

class Trav7 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'7

Methods

t'7 :: Traversal s t a b Source #

Instances

Trav7 x y (Union7 a b c d e f x) (Union7 a b c d e f y) Source # 

Methods

t'7 :: Traversal x y (Union7 a b c d e f x) (Union7 a b c d e f y) Source #

Trav7 x y (Union8 a b c d e f x g) (Union8 a b c d e f y g) Source # 

Methods

t'7 :: Traversal x y (Union8 a b c d e f x g) (Union8 a b c d e f y g) Source #

Trav7 x y (Union9 a b c d e f x g h) (Union9 a b c d e f y g h) Source # 

Methods

t'7 :: Traversal x y (Union9 a b c d e f x g h) (Union9 a b c d e f y g h) Source #

class Trav8 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'8

Methods

t'8 :: Traversal s t a b Source #

Instances

Trav8 x y (Union8 a b c d e f g x) (Union8 a b c d e f g y) Source # 

Methods

t'8 :: Traversal x y (Union8 a b c d e f g x) (Union8 a b c d e f g y) Source #

Trav8 x y (Union9 a b c d e f g x h) (Union9 a b c d e f g y h) Source # 

Methods

t'8 :: Traversal x y (Union9 a b c d e f g x h) (Union9 a b c d e f g y h) Source #

class Trav9 s t a b | a -> s, a t -> b where Source #

Minimal complete definition

t'9

Methods

t'9 :: Traversal s t a b Source #

Instances

Trav9 x y (Union9 a b c d e f g h x) (Union9 a b c d e f g h y) Source # 

Methods

t'9 :: Traversal x y (Union9 a b c d e f g h x) (Union9 a b c d e f g h y) Source #

class Compound a b s t | s -> a, b s -> t where Source #

Minimal complete definition

each

Methods

each :: Traversal a b s t Source #

Instances

Compound a b ((:+:) a a) ((:+:) b b) Source # 

Methods

each :: Traversal a b (a :+: a) (b :+: b) Source #

Compound a b (a, a) (b, b) Source # 

Methods

each :: Traversal a b (a, a) (b, b) Source #

Compound a b (a, a, a) (b, b, b) Source # 

Methods

each :: Traversal a b (a, a, a) (b, b, b) Source #

i'list :: [a] :<->: (() :+: (a :*: [a])) Source #

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

l'Just :: a -> Lens a a (Maybe a) (Maybe a) Source #

Isomorphisms

class Isomorphic b a t s | t -> b, t a -> s where Source #

Minimal complete definition

i'_

Methods

i'_ :: Iso s t a b Source #

Instances

Isomorphic Bool Bool (Maybe a) (Maybe Void) Source # 

Methods

i'_ :: Iso (Maybe Void) (Maybe a) Bool Bool Source #

Isomorphic a b (Max a) (Max b) Source # 

Methods

i'_ :: Iso (Max b) (Max a) b a Source #

Isomorphic a b (Product a) (Product b) Source # 

Methods

i'_ :: Iso (Product b) (Product a) b a Source #

Isomorphic a b (Dual a) (Dual b) Source # 

Methods

i'_ :: Iso (Dual b) (Dual a) b a Source #

Isomorphic a b (Id a) (Id b) Source # 

Methods

i'_ :: Iso (Id b) (Id a) b a Source #

Isomorphic a b (Void, a) (Void, b) Source # 

Methods

i'_ :: Iso (Void, b) (Void, a) b a Source #

Isomorphic a b (Const a c) (Const b c) Source # 

Methods

i'_ :: Iso (Const b c) (Const a c) b a Source #

Isomorphic [a] [b] (OrdList a) (OrdList b) Source # 

Methods

i'_ :: Iso (OrdList b) (OrdList a) [b] [a] Source #

Isomorphic (f (g a)) (f' (g' b)) ((:.:) f g a) ((:.:) f' g' b) Source # 

Methods

i'_ :: Iso ((f' :.: g') b) ((f :.: g) a) (f' (g' b)) (f (g a)) Source #

Isomorphic (k a a) (k b b) (Endo k a) (Endo k b) Source # 

Methods

i'_ :: Iso (Endo k b) (Endo k a) (k b b) (k a a) Source #

Isomorphic (a -> m b) (c -> m' d) (Kleisli m a b) (Kleisli m' c d) Source # 

Methods

i'_ :: Iso (Kleisli m' c d) (Kleisli m a b) (c -> m' d) (a -> m b) Source #

Isomorphic (f a b) (f c d) (Flip f b a) (Flip f d c) Source # 

Methods

i'_ :: Iso (Flip f d c) (Flip f b a) (f c d) (f a b) Source #

Miscellaneous

thunk :: Iso a b (IO a) (IO b) Source #

curried :: Iso (a -> b -> c) (a' -> b' -> c') ((a, b) -> c) ((a', b') -> c') Source #

Type wrappers

i'Id :: Iso (Id a) (Id b) a b Source #

i'OrdList :: Iso (OrdList a) (OrdList b) [a] [b] Source #

i'Const :: Iso (Const a c) (Const b c) a b Source #

i'Dual :: Iso (Dual a) (Dual b) a b Source #

i'Endo :: Iso (Endo k a) (Endo k b) (k a a) (k b b) Source #

i'Flip :: Iso (Flip f b a) (Flip f d c) (f a b) (f c d) Source #

i'Max :: Iso (Max a) (Max b) a b Source #

i'Compose :: Iso ((f :.: g) a) ((f' :.: g') b) (f (g a)) (f' (g' b)) Source #

i'Backwards :: Iso (Backwards f a) (Backwards g b) (f a) (g b) Source #

i'Accum :: Iso (Accum a) (Accum b) (Maybe a) (Maybe b) Source #

Algebraic isomorphisms

negated :: (Disjonctive a, Disjonctive b) => Iso a b a b Source #

commuted :: Commutative f => Iso (f a b) (f c d) (f b a) (f d c) Source #

adding :: (Num n, Semigroup n) => n -> Iso' n n Source #

Higher-order isomorphisms

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

mapping :: (Functor f, Functor f') => Iso s t a b -> Iso (f s) (f' t) (f a) (f' b) Source #

mapping' :: Functor f => Iso s t a b -> Iso (f s) (f t) (f a) (f b) Source #

promapping :: Bifunctor f => Iso s t a b -> Iso (f t x) (f s y) (f b x) (f a y) Source #

promapping :: Bifunctor f => Iso' a b -> Iso' (f a c) (f b c)

applying :: Applicative f => Lens s t a b -> Lens (f s) (f t) (f a) (f b) Source #

class IsoFunctor f where Source #

Minimal complete definition

mapIso

Methods

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

Instances

IsoFunctor ((->) a) Source # 

Methods

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

(<.>) :: IsoFunctor2 f => (a :<->: c) -> (b :<->: d) -> f a b :<->: f c d infixr 9 Source #

An infix synonym for mapIso2

class IsoFunctor2 f where Source #

Minimal complete definition

mapIso2

Methods

mapIso2 :: (a :<->: c) -> (b :<->: d) -> f a b :<->: f c d Source #

Instances

IsoFunctor2 (->) Source # 

Methods

mapIso2 :: (a :<->: c) -> (b :<->: d) -> (a -> b) :<->: (c -> d) Source #

IsoFunctor2 Either Source # 

Methods

mapIso2 :: (a :<->: c) -> (b :<->: d) -> Either a b :<->: Either c d Source #

IsoFunctor2 (,) Source # 

Methods

mapIso2 :: (a :<->: c) -> (b :<->: d) -> (a, b) :<->: (c, d) Source #