Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Optic p s t a b = p a b -> p s t
- type Optic' p s a = Optic p s s a a
- type Affine p = (Choice p, Strong p)
- type Coaffine p = (Choice p, Closed p)
- type Traversing p = (Representable p, Applicative' (Rep p))
- type Cotraversing p = (Corepresentable p, Coapplicative (Corep p))
- type Traversing1 p = (Representable p, Apply (Rep p))
- type Cotraversing1 p = (Corepresentable p, Coapply (Corep p))
- type CoerceL p = Bifunctor p
- type CoerceR p = forall x. Contravariant (p x)
- type Mapping p = (Representable p, Distributive (Rep p))
- type Comapping p = (Corepresentable p, Traversable (Corep p))
- type Mapping1 p = (Representable p, Distributive1 (Rep p))
- type Comapping1 p = (Corepresentable p, Traversable1 (Corep p))
- type Equality s t a b = forall p. Optic p s t a b
- type Equality' s a = Equality s s a a
- type Iso s t a b = forall p. Profunctor p => Optic p s t a b
- type Iso' s a = Iso s s a a
- type Prism s t a b = forall p. Choice p => Optic p s t a b
- type Coprism s t a b = forall p. Cochoice p => Optic p s t a b
- type Prism' s a = Prism s s a a
- type Coprism' t b = Coprism t t b b
- type Lens s t a b = forall p. Strong p => Optic p s t a b
- type Colens s t a b = forall p. Costrong p => Optic p s t a b
- type Lens' s a = Lens s s a a
- type Colens' t b = Lens t t b b
- type Grate s t a b = forall p. Closed p => Optic p s t a b
- type Grate' s a = Grate s s a a
- type Traversal0 s t a b = forall p. Affine p => Optic p s t a b
- type Cotraversal0 s t a b = forall p. Coaffine p => Optic p s t a b
- type Traversal s t a b = forall p. (Affine p, Traversing p) => Optic p s t a b
- type Cotraversal s t a b = forall p. (Coaffine p, Cotraversing p) => Optic p s t a b
- type Traversal1 s t a b = forall p. (Strong p, Traversing1 p) => Optic p s t a b
- type Cotraversal1 s t a b = forall p. (Closed p, Cotraversing1 p) => Optic p s t a b
- type Traversal0' s a = Traversal0 s s a a
- type Cotraversal0' t b = Cotraversal0 t t b b
- type Traversal' s a = Traversal s s a a
- type Cotraversal' t b = Cotraversal t t b b
- type Traversal1' s a = Traversal1 s s a a
- type Cotraversal1' t b = Cotraversal1 t t b b
- type Fold0 s a = forall p. (Affine p, CoerceR p) => Optic' p s a
- type Fold s a = forall p. (Affine p, Traversing p, CoerceR p) => Optic' p s a
- type Fold1 s a = forall p. (Strong p, Traversing1 p, CoerceR p) => Optic' p s a
- type Setter s t a b = forall p. (Affine p, Traversing p, Mapping p) => Optic p s t a b
- type Resetter s t a b = forall p. (Coaffine p, Cotraversing p, Comapping p) => Optic p s t a b
- type Setter' s a = Setter s s a a
- type Resetter' s a = Resetter s s a a
- type View s a = forall p. (Strong p, CoerceR p) => Optic' p s a
- type Review t b = forall p. (Closed p, CoerceL p) => Optic' p t b
- newtype Re p s t a b = Re {
- runRe :: p b a -> p t s
- re :: Optic (Re p a b) s t a b -> Optic p b a t s
- between :: (c -> d) -> (a -> b) -> (b -> c) -> a -> d
- module Data.Profunctor.Types
Optic
Constraints
type Traversing p = (Representable p, Applicative' (Rep p)) Source #
type Cotraversing p = (Corepresentable p, Coapplicative (Corep p)) Source #
type Traversing1 p = (Representable p, Apply (Rep p)) Source #
type Cotraversing1 p = (Corepresentable p, Coapply (Corep p)) Source #
type CoerceR p = forall x. Contravariant (p x) Source #
type Mapping p = (Representable p, Distributive (Rep p)) Source #
type Comapping p = (Corepresentable p, Traversable (Corep p)) Source #
type Mapping1 p = (Representable p, Distributive1 (Rep p)) Source #
type Comapping1 p = (Corepresentable p, Traversable1 (Corep p)) Source #
Equality
Iso
type Iso s t a b = forall p. Profunctor p => Optic p s t a b Source #
\( \mathsf{Iso}\;S\;A = S \cong A \)
Prism
type Prism s t a b = forall p. Choice p => Optic p s t a b Source #
\( \mathsf{Prism}\;S\;A = \exists D, S \cong D + A \)
type Coprism s t a b = forall p. Cochoice p => Optic p s t a b Source #
\( \mathsf{Prism}\;S\;A = \exists D, S + D \cong A \)
Lens
type Lens s t a b = forall p. Strong p => Optic p s t a b Source #
\( \mathsf{Lens}\;S\;A = \exists C, S \cong C \times A \)
type Colens s t a b = forall p. Costrong p => Optic p s t a b Source #
\( \mathsf{Lens}\;S\;A = \exists C, S \times C \cong A \)
Grate
type Grate s t a b = forall p. Closed p => Optic p s t a b Source #
\( \mathsf{Grate}\;S\;A = \exists I, S \cong I \to A \)
Traversal
type Traversal0 s t a b = forall p. Affine p => Optic p s t a b Source #
\( \mathsf{Traversal0}\;S\;A = \exists C, D, S \cong D + C \times A \)
type Cotraversal0 s t a b = forall p. Coaffine p => Optic p s t a b Source #
\( \mathsf{Cotraversal0}\;S\;A = \exists D, I, S \cong I \to D + A \)
type Traversal s t a b = forall p. (Affine p, Traversing p) => Optic p s t a b Source #
\( \mathsf{Traversal}\;S\;A = \exists F : \mathsf{Traversable}, S \equiv F\,A \)
type Cotraversal s t a b = forall p. (Coaffine p, Cotraversing p) => Optic p s t a b Source #
\( \mathsf{Cotraversal}\;S\;A = \exists F : \mathsf{Distributive}, S \equiv F\,A \)
type Traversal1 s t a b = forall p. (Strong p, Traversing1 p) => Optic p s t a b Source #
\( \mathsf{Traversal1}\;S\;A = \exists F : \mathsf{Traversable1}, S \equiv F\,A \)
type Cotraversal1 s t a b = forall p. (Closed p, Cotraversing1 p) => Optic p s t a b Source #
\( \mathsf{Cotraversal1}\;S\;A = \exists F : \mathsf{Distributive1}, S \equiv F\,A \)
type Traversal0' s a = Traversal0 s s a a Source #
type Cotraversal0' t b = Cotraversal0 t t b b Source #
type Traversal' s a = Traversal s s a a Source #
type Cotraversal' t b = Cotraversal t t b b Source #
type Traversal1' s a = Traversal1 s s a a Source #
type Cotraversal1' t b = Cotraversal1 t t b b Source #
Fold
Setter
type Setter s t a b = forall p. (Affine p, Traversing p, Mapping p) => Optic p s t a b Source #
\( \mathsf{Setter}\;S\;A = \exists F : \mathsf{Functor}, S \equiv F\,A \)
type Resetter s t a b = forall p. (Coaffine p, Cotraversing p, Comapping p) => Optic p s t a b Source #
\( \mathsf{Setter}\;S\;A = \exists F : \mathsf{Functor}, F\,S \equiv A \)
View
Re
The Re
type and its instances witness the symmetry between the parameters of a Profunctor
.
Instances
(Profunctor p, forall x. Contravariant (p x)) => Bifunctor (Re p s t) Source # | |
Cochoice p => Choice (Re p s t) Source # | |
Choice p => Cochoice (Re p s t) Source # | |
Costrong p => Strong (Re p s t) Source # | |
Strong p => Costrong (Re p s t) Source # | |
Profunctor p => Profunctor (Re p s t) Source # | |
Defined in Data.Profunctor.Optic.Types | |
Bifunctor p => Contravariant (Re p s t a) Source # | |
between :: (c -> d) -> (a -> b) -> (b -> c) -> a -> d Source #
Can be used to rewrite
\g -> f . g . h
to
between f h
module Data.Profunctor.Types