diagrams-lib-1.4.6: Embedded domain-specific language for declarative graphics

Copyright | (c) 2011-2015 diagrams-lib team (see LICENSE)
License | BSD-style (see LICENSE)
Maintainer | diagrams-discuss@googlegroups.com
Safe Haskell | Safe-Inferred
Language | Haskell2010

Diagrams.Prelude

Contents

- Diagrams library
- Convenience re-exports from other packages

Description

A module to re-export most of the functionality of the diagrams core and standard library.

Synopsis

- module Diagrams
- module Data.Default.Class
- class ColourOps (f :: Type -> Type) where
  - darken :: Num a => a -> f a -> f a
- data AlphaColour a
- data Colour a
- colourConvert :: (Fractional b, Real a) => Colour a -> Colour b
- black :: Num a => Colour a
- transparent :: Num a => AlphaColour a
- alphaColourConvert :: (Fractional b, Real a) => AlphaColour a -> AlphaColour b
- opaque :: Num a => Colour a -> AlphaColour a
- dissolve :: Num a => a -> AlphaColour a -> AlphaColour a
- withOpacity :: Num a => Colour a -> a -> AlphaColour a
- blend :: (Num a, AffineSpace f) => a -> f a -> f a -> f a
- alphaChannel :: AlphaColour a -> a
- black :: Num a => Colour a
- readColourName :: (MonadFail m, Monad m, Ord a, Floating a) => String -> m (Colour a)
- aliceblue :: (Ord a, Floating a) => Colour a
- antiquewhite :: (Ord a, Floating a) => Colour a
- aqua :: (Ord a, Floating a) => Colour a
- aquamarine :: (Ord a, Floating a) => Colour a
- azure :: (Ord a, Floating a) => Colour a
- beige :: (Ord a, Floating a) => Colour a
- bisque :: (Ord a, Floating a) => Colour a
- blanchedalmond :: (Ord a, Floating a) => Colour a
- blue :: (Ord a, Floating a) => Colour a
- blueviolet :: (Ord a, Floating a) => Colour a
- brown :: (Ord a, Floating a) => Colour a
- burlywood :: (Ord a, Floating a) => Colour a
- cadetblue :: (Ord a, Floating a) => Colour a
- chartreuse :: (Ord a, Floating a) => Colour a
- chocolate :: (Ord a, Floating a) => Colour a
- coral :: (Ord a, Floating a) => Colour a
- cornflowerblue :: (Ord a, Floating a) => Colour a
- cornsilk :: (Ord a, Floating a) => Colour a
- crimson :: (Ord a, Floating a) => Colour a
- cyan :: (Ord a, Floating a) => Colour a
- darkblue :: (Ord a, Floating a) => Colour a
- darkcyan :: (Ord a, Floating a) => Colour a
- darkgoldenrod :: (Ord a, Floating a) => Colour a
- darkgray :: (Ord a, Floating a) => Colour a
- darkgreen :: (Ord a, Floating a) => Colour a
- darkgrey :: (Ord a, Floating a) => Colour a
- darkkhaki :: (Ord a, Floating a) => Colour a
- darkmagenta :: (Ord a, Floating a) => Colour a
- darkolivegreen :: (Ord a, Floating a) => Colour a
- darkorange :: (Ord a, Floating a) => Colour a
- darkorchid :: (Ord a, Floating a) => Colour a
- darkred :: (Ord a, Floating a) => Colour a
- darksalmon :: (Ord a, Floating a) => Colour a
- darkseagreen :: (Ord a, Floating a) => Colour a
- darkslateblue :: (Ord a, Floating a) => Colour a
- darkslategray :: (Ord a, Floating a) => Colour a
- darkslategrey :: (Ord a, Floating a) => Colour a
- darkturquoise :: (Ord a, Floating a) => Colour a
- darkviolet :: (Ord a, Floating a) => Colour a
- deeppink :: (Ord a, Floating a) => Colour a
- deepskyblue :: (Ord a, Floating a) => Colour a
- dimgray :: (Ord a, Floating a) => Colour a
- dimgrey :: (Ord a, Floating a) => Colour a
- dodgerblue :: (Ord a, Floating a) => Colour a
- firebrick :: (Ord a, Floating a) => Colour a
- floralwhite :: (Ord a, Floating a) => Colour a
- forestgreen :: (Ord a, Floating a) => Colour a
- fuchsia :: (Ord a, Floating a) => Colour a
- gainsboro :: (Ord a, Floating a) => Colour a
- ghostwhite :: (Ord a, Floating a) => Colour a
- gold :: (Ord a, Floating a) => Colour a
- goldenrod :: (Ord a, Floating a) => Colour a
- gray :: (Ord a, Floating a) => Colour a
- grey :: (Ord a, Floating a) => Colour a
- green :: (Ord a, Floating a) => Colour a
- greenyellow :: (Ord a, Floating a) => Colour a
- honeydew :: (Ord a, Floating a) => Colour a
- hotpink :: (Ord a, Floating a) => Colour a
- indianred :: (Ord a, Floating a) => Colour a
- indigo :: (Ord a, Floating a) => Colour a
- ivory :: (Ord a, Floating a) => Colour a
- khaki :: (Ord a, Floating a) => Colour a
- lavender :: (Ord a, Floating a) => Colour a
- lavenderblush :: (Ord a, Floating a) => Colour a
- lawngreen :: (Ord a, Floating a) => Colour a
- lemonchiffon :: (Ord a, Floating a) => Colour a
- lightblue :: (Ord a, Floating a) => Colour a
- lightcoral :: (Ord a, Floating a) => Colour a
- lightcyan :: (Ord a, Floating a) => Colour a
- lightgoldenrodyellow :: (Ord a, Floating a) => Colour a
- lightgray :: (Ord a, Floating a) => Colour a
- lightgreen :: (Ord a, Floating a) => Colour a
- lightgrey :: (Ord a, Floating a) => Colour a
- lightpink :: (Ord a, Floating a) => Colour a
- lightsalmon :: (Ord a, Floating a) => Colour a
- lightseagreen :: (Ord a, Floating a) => Colour a
- lightskyblue :: (Ord a, Floating a) => Colour a
- lightslategray :: (Ord a, Floating a) => Colour a
- lightslategrey :: (Ord a, Floating a) => Colour a
- lightsteelblue :: (Ord a, Floating a) => Colour a
- lightyellow :: (Ord a, Floating a) => Colour a
- lime :: (Ord a, Floating a) => Colour a
- limegreen :: (Ord a, Floating a) => Colour a
- linen :: (Ord a, Floating a) => Colour a
- magenta :: (Ord a, Floating a) => Colour a
- maroon :: (Ord a, Floating a) => Colour a
- mediumaquamarine :: (Ord a, Floating a) => Colour a
- mediumblue :: (Ord a, Floating a) => Colour a
- mediumorchid :: (Ord a, Floating a) => Colour a
- mediumpurple :: (Ord a, Floating a) => Colour a
- mediumseagreen :: (Ord a, Floating a) => Colour a
- mediumslateblue :: (Ord a, Floating a) => Colour a
- mediumspringgreen :: (Ord a, Floating a) => Colour a
- mediumturquoise :: (Ord a, Floating a) => Colour a
- mediumvioletred :: (Ord a, Floating a) => Colour a
- midnightblue :: (Ord a, Floating a) => Colour a
- mintcream :: (Ord a, Floating a) => Colour a
- mistyrose :: (Ord a, Floating a) => Colour a
- moccasin :: (Ord a, Floating a) => Colour a
- navajowhite :: (Ord a, Floating a) => Colour a
- navy :: (Ord a, Floating a) => Colour a
- oldlace :: (Ord a, Floating a) => Colour a
- olive :: (Ord a, Floating a) => Colour a
- olivedrab :: (Ord a, Floating a) => Colour a
- orange :: (Ord a, Floating a) => Colour a
- orangered :: (Ord a, Floating a) => Colour a
- orchid :: (Ord a, Floating a) => Colour a
- palegoldenrod :: (Ord a, Floating a) => Colour a
- palegreen :: (Ord a, Floating a) => Colour a
- paleturquoise :: (Ord a, Floating a) => Colour a
- palevioletred :: (Ord a, Floating a) => Colour a
- papayawhip :: (Ord a, Floating a) => Colour a
- peachpuff :: (Ord a, Floating a) => Colour a
- peru :: (Ord a, Floating a) => Colour a
- pink :: (Ord a, Floating a) => Colour a
- plum :: (Ord a, Floating a) => Colour a
- powderblue :: (Ord a, Floating a) => Colour a
- purple :: (Ord a, Floating a) => Colour a
- red :: (Ord a, Floating a) => Colour a
- rosybrown :: (Ord a, Floating a) => Colour a
- royalblue :: (Ord a, Floating a) => Colour a
- saddlebrown :: (Ord a, Floating a) => Colour a
- salmon :: (Ord a, Floating a) => Colour a
- sandybrown :: (Ord a, Floating a) => Colour a
- seagreen :: (Ord a, Floating a) => Colour a
- seashell :: (Ord a, Floating a) => Colour a
- sienna :: (Ord a, Floating a) => Colour a
- silver :: (Ord a, Floating a) => Colour a
- skyblue :: (Ord a, Floating a) => Colour a
- slateblue :: (Ord a, Floating a) => Colour a
- slategray :: (Ord a, Floating a) => Colour a
- slategrey :: (Ord a, Floating a) => Colour a
- snow :: (Ord a, Floating a) => Colour a
- springgreen :: (Ord a, Floating a) => Colour a
- steelblue :: (Ord a, Floating a) => Colour a
- teal :: (Ord a, Floating a) => Colour a
- thistle :: (Ord a, Floating a) => Colour a
- tomato :: (Ord a, Floating a) => Colour a
- turquoise :: (Ord a, Floating a) => Colour a
- violet :: (Ord a, Floating a) => Colour a
- wheat :: (Ord a, Floating a) => Colour a
- white :: (Ord a, Floating a) => Colour a
- whitesmoke :: (Ord a, Floating a) => Colour a
- yellow :: (Ord a, Floating a) => Colour a
- yellowgreen :: (Ord a, Floating a) => Colour a
- module Data.Colour.SRGB
- module Data.Semigroup
- module Linear.Vector
- module Linear.Affine
- module Linear.Metric
- module Data.Active
- type Traversal s t a b = forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t
- type Fold s a = forall (f :: Type -> Type). (Contravariant f, Applicative f) => (a -> f a) -> s -> f s
- class Contravariant (f :: Type -> Type) where
  - contramap :: (a' -> a) -> f a -> f a'
  - (>$) :: b -> f b -> f a
- class Bifunctor (p :: Type -> Type -> Type) where
  - bimap :: (a -> b) -> (c -> d) -> p a c -> p b d
- class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where
  - traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
- data (a :: k) :~: (b :: k) where
  - Refl :: forall {k} (a :: k). a :~: a
- newtype Identity a = Identity {
  - runIdentity :: a
  }
- newtype Const a (b :: k) = Const {
  - getConst :: a
  }
- type Iso s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Profunctor p, Functor f) => p a (f b) -> p s (f t)
- type IndexedTraversal i s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Applicative f) => p a (f b) -> s -> f t
- type IndexedFold i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> s -> f s
- type Prism s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Choice p, Applicative f) => p a (f b) -> p s (f t)
- type Lens s t a b = forall (f :: Type -> Type). Functor f => (a -> f b) -> s -> f t
- type IndexedLens i s t a b = forall (f :: Type -> Type) (p :: Type -> Type -> Type). (Indexable i p, Functor f) => p a (f b) -> s -> f t
- type Getter s a = forall (f :: Type -> Type). (Contravariant f, Functor f) => (a -> f a) -> s -> f s
- type IndexedGetter i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Functor f) => p a (f a) -> s -> f s
- type LensLike (f :: k -> Type) s (t :: k) a (b :: k) = (a -> f b) -> s -> f t
- type Over (p :: k -> Type -> Type) (f :: k1 -> Type) s (t :: k1) (a :: k) (b :: k1) = p a (f b) -> s -> f t
- newtype Bazaar (p :: Type -> Type -> Type) a b t = Bazaar {
  - runBazaar :: forall (f :: Type -> Type). Applicative f => p a (f b) -> f t
  }
- type Setter s t a b = forall (f :: Type -> Type). Settable f => (a -> f b) -> s -> f t
- class (MonadState s m, MonadState t n) => Zoom (m :: Type -> Type) (n :: Type -> Type) s t | m -> s, n -> t, m t -> n, n s -> m where
  - zoom :: LensLike' (Zoomed m c) t s -> m c -> n c
- type Getting r s a = (a -> Const r a) -> s -> Const r s
- type Traversal' s a = Traversal s s a a
- type Setter' s a = Setter s s a a
- type Iso' s a = Iso s s a a
- class AsEmpty a where
  - _Empty :: Prism' a ()
- newtype ReifiedTraversal s t a b = Traversal {
  - runTraversal :: Traversal s t a b
  }
- type Prism' s a = Prism s s a a
- type Lens' s a = Lens s s a a
- newtype Indexed i a b = Indexed {
  - runIndexed :: i -> a -> b
  }
- type Simple (f :: k1 -> k1 -> k2 -> k2 -> k) (s :: k1) (a :: k2) = f s s a a
- class Wrapped s where
  - type Unwrapped s
  - _Wrapped' :: Iso' s (Unwrapped s)
- class (FunctorWithIndex i t, FoldableWithIndex i t, Traversable t) => TraversableWithIndex i (t :: Type -> Type) | t -> i where
  - itraverse :: Applicative f => (i -> a -> f b) -> t a -> f (t b)
- class Foldable f => FoldableWithIndex i (f :: Type -> Type) | f -> i where
  - ifoldMap :: Monoid m => (i -> a -> m) -> f a -> m
  - ifoldMap' :: Monoid m => (i -> a -> m) -> f a -> m
  - ifoldr :: (i -> a -> b -> b) -> b -> f a -> b
  - ifoldl :: (i -> b -> a -> b) -> b -> f a -> b
  - ifoldr' :: (i -> a -> b -> b) -> b -> f a -> b
  - ifoldl' :: (i -> b -> a -> b) -> b -> f a -> b
- class Functor f => FunctorWithIndex i (f :: Type -> Type) | f -> i where
  - imap :: (i -> a -> b) -> f a -> f b
- class Profunctor (p :: Type -> Type -> Type) where
  - dimap :: (a -> b) -> (c -> d) -> p b c -> p a d
  - lmap :: (a -> b) -> p b c -> p a c
  - rmap :: (b -> c) -> p a b -> p a c
- class Profunctor p => Choice (p :: Type -> Type -> Type) where
  - left' :: p a b -> p (Either a c) (Either b c)
  - right' :: p a b -> p (Either c a) (Either c b)
- class (Foldable1 t, Traversable t) => Traversable1 (t :: Type -> Type) where
  - traverse1 :: Apply f => (a -> f b) -> t a -> f (t b)
- class Reversing t where
  - reversing :: t -> t
- data Level i a
- class Conjoined p => Indexable i (p :: Type -> Type -> Type)
- class (Choice p, Corepresentable p, Comonad (Corep p), Traversable (Corep p), Strong p, Representable p, Monad (Rep p), MonadFix (Rep p), Distributive (Rep p), Costrong p, ArrowLoop p, ArrowApply p, ArrowChoice p, Closed p) => Conjoined (p :: Type -> Type -> Type) where
  - distrib :: Functor f => p a b -> p (f a) (f b)
  - conjoined :: (p ~ (->) => q (a -> b) r) -> q (p a b) r -> q (p a b) r
- data Rightmost a
- data Leftmost a
- data Sequenced a (m :: Type -> Type)
- data Traversed a (f :: Type -> Type)
- type Context' a = Context a a
- data Context a b t = Context (b -> t) a
- type Bazaar1' (p :: Type -> Type -> Type) a = Bazaar1 p a a
- newtype Bazaar1 (p :: Type -> Type -> Type) a b t = Bazaar1 {
  - runBazaar1 :: forall (f :: Type -> Type). Apply f => p a (f b) -> f t
  }
- type Bazaar' (p :: Type -> Type -> Type) a = Bazaar p a a
- data Magma i t b a
- class (Profunctor p, Bifunctor p) => Reviewable (p :: Type -> Type -> Type)
- class (Applicative f, Distributive f, Traversable f) => Settable (f :: Type -> Type)
- type Over' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Over p f s s a a
- type IndexedLensLike' i (f :: Type -> Type) s a = IndexedLensLike i f s s a a
- type IndexedLensLike i (f :: k -> Type) s (t :: k) a (b :: k) = forall (p :: Type -> Type -> Type). Indexable i p => p a (f b) -> s -> f t
- type LensLike' (f :: Type -> Type) s a = LensLike f s s a a
- type Optical' (p :: k -> k1 -> Type) (q :: k -> k1 -> Type) (f :: k -> k1) (s :: k) (a :: k) = Optical p q f s s a a
- type Optical (p :: k -> k1 -> Type) (q :: k2 -> k1 -> Type) (f :: k3 -> k1) (s :: k2) (t :: k3) (a :: k) (b :: k3) = p a (f b) -> q s (f t)
- type Optic' (p :: k -> k1 -> Type) (f :: k -> k1) (s :: k) (a :: k) = Optic p f s s a a
- type Optic (p :: k -> k1 -> Type) (f :: k2 -> k1) (s :: k) (t :: k2) (a :: k) (b :: k2) = p a (f b) -> p s (f t)
- type IndexPreservingFold1 s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Apply f) => p a (f a) -> p s (f s)
- type IndexedFold1 i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Apply f) => p a (f a) -> s -> f s
- type Fold1 s a = forall (f :: Type -> Type). (Contravariant f, Apply f) => (a -> f a) -> s -> f s
- type IndexPreservingFold s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Applicative f) => p a (f a) -> p s (f s)
- type IndexPreservingGetter s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Functor f) => p a (f a) -> p s (f s)
- type As (a :: k2) = Equality' a a
- type Equality' (s :: k2) (a :: k2) = Equality s s a a
- type Equality (s :: k1) (t :: k2) (a :: k1) (b :: k2) = forall k3 (p :: k1 -> k3 -> Type) (f :: k2 -> k3). p a (f b) -> p s (f t)
- type AReview t b = Optic' (Tagged :: Type -> Type -> Type) Identity t b
- type Review t b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Choice p, Bifunctor p, Settable f) => Optic' p f t b
- type IndexPreservingSetter' s a = IndexPreservingSetter s s a a
- type IndexPreservingSetter s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Settable f) => p a (f b) -> p s (f t)
- type IndexedSetter' i s a = IndexedSetter i s s a a
- type IndexedSetter i s t a b = forall (f :: Type -> Type) (p :: Type -> Type -> Type). (Indexable i p, Settable f) => p a (f b) -> s -> f t
- type IndexPreservingTraversal1' s a = IndexPreservingTraversal1 s s a a
- type IndexPreservingTraversal1 s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Apply f) => p a (f b) -> p s (f t)
- type IndexPreservingTraversal' s a = IndexPreservingTraversal s s a a
- type IndexPreservingTraversal s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Applicative f) => p a (f b) -> p s (f t)
- type IndexedTraversal1' i s a = IndexedTraversal1 i s s a a
- type IndexedTraversal1 i s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Apply f) => p a (f b) -> s -> f t
- type IndexedTraversal' i s a = IndexedTraversal i s s a a
- type Traversal1' s a = Traversal1 s s a a
- type Traversal1 s t a b = forall (f :: Type -> Type). Apply f => (a -> f b) -> s -> f t
- type IndexPreservingLens' s a = IndexPreservingLens s s a a
- type IndexPreservingLens s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Functor f) => p a (f b) -> p s (f t)
- type IndexedLens' i s a = IndexedLens i s s a a
- type Setting' (p :: Type -> Type -> Type) s a = Setting p s s a a
- type Setting (p :: Type -> Type -> Type) s t a b = p a (Identity b) -> s -> Identity t
- type AnIndexedSetter' i s a = AnIndexedSetter i s s a a
- type AnIndexedSetter i s t a b = Indexed i a (Identity b) -> s -> Identity t
- type ASetter' s a = ASetter s s a a
- type ASetter s t a b = (a -> Identity b) -> s -> Identity t
- type AnIndexedLens' i s a = AnIndexedLens i s s a a
- type AnIndexedLens i s t a b = Optical (Indexed i) (->) (Pretext (Indexed i) a b) s t a b
- type ALens' s a = ALens s s a a
- type ALens s t a b = LensLike (Pretext (->) a b) s t a b
- class Field19 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _19 :: Lens s t a b
- class Field18 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _18 :: Lens s t a b
- class Field17 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _17 :: Lens s t a b
- class Field16 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _16 :: Lens s t a b
- class Field15 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _15 :: Lens s t a b
- class Field14 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _14 :: Lens s t a b
- class Field13 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _13 :: Lens s t a b
- class Field12 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _12 :: Lens s t a b
- class Field11 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _11 :: Lens s t a b
- class Field10 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _10 :: Lens s t a b
- class Field9 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _9 :: Lens s t a b
- class Field8 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _8 :: Lens s t a b
- class Field7 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _7 :: Lens s t a b
- class Field6 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _6 :: Lens s t a b
- class Field5 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _5 :: Lens s t a b
- class Field4 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _4 :: Lens s t a b
- class Field3 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _3 :: Lens s t a b
- class Field2 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _2 :: Lens s t a b
- class Field1 s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _1 :: Lens s t a b
- type Accessing (p :: Type -> Type -> Type) m s a = p a (Const m a) -> s -> Const m s
- type IndexedGetting i m s a = Indexed i a (Const m a) -> s -> Const m s
- class Suffixed t where
  - suffixed :: t -> Prism' t t
- class Prefixed t where
  - prefixed :: t -> Prism' t t
- type APrism' s a = APrism s s a a
- type APrism s t a b = Market a b a (Identity b) -> Market a b s (Identity t)
- class Ord k => TraverseMax k (m :: Type -> Type) | m -> k where
  - traverseMax :: IndexedTraversal' k (m v) v
- class Ord k => TraverseMin k (m :: Type -> Type) | m -> k where
  - traverseMin :: IndexedTraversal' k (m v) v
- type Traversing1' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Traversing1 p f s s a a
- type Traversing' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Traversing p f s s a a
- type Traversing1 (p :: Type -> Type -> Type) (f :: Type -> Type) s t a b = Over p (BazaarT1 p f a b) s t a b
- type Traversing (p :: Type -> Type -> Type) (f :: Type -> Type) s t a b = Over p (BazaarT p f a b) s t a b
- type AnIndexedTraversal1' i s a = AnIndexedTraversal1 i s s a a
- type AnIndexedTraversal' i s a = AnIndexedTraversal i s s a a
- type AnIndexedTraversal1 i s t a b = Over (Indexed i) (Bazaar1 (Indexed i) a b) s t a b
- type AnIndexedTraversal i s t a b = Over (Indexed i) (Bazaar (Indexed i) a b) s t a b
- type ATraversal1' s a = ATraversal1 s s a a
- type ATraversal1 s t a b = LensLike (Bazaar1 (->) a b) s t a b
- type ATraversal' s a = ATraversal s s a a
- type ATraversal s t a b = LensLike (Bazaar (->) a b) s t a b
- type ReifiedPrism' s a = ReifiedPrism s s a a
- newtype ReifiedPrism s t a b = Prism {
  - runPrism :: Prism s t a b
  }
- type ReifiedIso' s a = ReifiedIso s s a a
- newtype ReifiedIso s t a b = Iso {
  - runIso :: Iso s t a b
  }
- type ReifiedIndexedSetter' i s a = ReifiedIndexedSetter i s s a a
- newtype ReifiedIndexedSetter i s t a b = IndexedSetter {
  - runIndexedSetter :: IndexedSetter i s t a b
  }
- type ReifiedSetter' s a = ReifiedSetter s s a a
- newtype ReifiedSetter s t a b = Setter {
  - runSetter :: Setter s t a b
  }
- newtype ReifiedIndexedFold i s a = IndexedFold {
  - runIndexedFold :: IndexedFold i s a
  }
- newtype ReifiedFold s a = Fold {
  - runFold :: Fold s a
  }
- newtype ReifiedIndexedGetter i s a = IndexedGetter {
  - runIndexedGetter :: IndexedGetter i s a
  }
- newtype ReifiedGetter s a = Getter {
  - runGetter :: Getter s a
  }
- type ReifiedTraversal' s a = ReifiedTraversal s s a a
- type ReifiedIndexedTraversal' i s a = ReifiedIndexedTraversal i s s a a
- newtype ReifiedIndexedTraversal i s t a b = IndexedTraversal {
  - runIndexedTraversal :: IndexedTraversal i s t a b
  }
- type ReifiedIndexedLens' i s a = ReifiedIndexedLens i s s a a
- newtype ReifiedIndexedLens i s t a b = IndexedLens {
  - runIndexedLens :: IndexedLens i s t a b
  }
- type ReifiedLens' s a = ReifiedLens s s a a
- newtype ReifiedLens s t a b = Lens {
  - runLens :: Lens s t a b
  }
- type AnEquality' (s :: k) (a :: k) = AnEquality s s a a
- type AnEquality (s :: k) (t :: k1) (a :: k) (b :: k2) = Identical a (Proxy b) a (Proxy b) -> Identical a (Proxy b) s (Proxy t)
- data Identical (a :: k) (b :: k1) (s :: k) (t :: k1) where
  - Identical :: forall {k} {k1} (a :: k) (b :: k1). Identical a b a b
- type AnIso' s a = AnIso s s a a
- type AnIso s t a b = Exchange a b a (Identity b) -> Exchange a b s (Identity t)
- class Snoc s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _Snoc :: Prism s t (s, a) (t, b)
- class Cons s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - _Cons :: Prism s t (a, s) (b, t)
- class (Rewrapped s t, Rewrapped t s) => Rewrapping s t
- class Wrapped s => Rewrapped s t
- type family Unwrapped s
- class (Magnified m ~ Magnified n, MonadReader b m, MonadReader a n) => Magnify (m :: Type -> Type) (n :: Type -> Type) b a | m -> b, n -> a, m a -> n, n b -> m where
  - magnify :: ((Functor (Magnified m c), Contravariant (Magnified m c)) => LensLike' (Magnified m c) a b) -> m c -> n c
- type family Magnified (m :: Type -> Type) :: Type -> Type -> Type
- type family Zoomed (m :: Type -> Type) :: Type -> Type -> Type
- class GPlated1 (f :: k -> Type) (g :: k -> Type)
- class GPlated a (g :: k -> Type)
- class Plated a where
  - plate :: Traversal' a a
- class Each s t a b | s -> a, t -> b, s b -> t, t a -> s where
  - each :: Traversal s t a b
- class Ixed m => At m
- class Ixed m where
  - ix :: Index m -> Traversal' m (IxValue m)
- type family IxValue m
- class Contains m
- type family Index s
- type ClassyNamer = Name -> Maybe (Name, Name)
- data DefName
  - = TopName Name
  - | MethodName Name Name
- type FieldNamer = Name -> [Name] -> Name -> [DefName]
- data LensRules
- pattern Empty :: AsEmpty s => s
- pattern (:>) :: Snoc a a b b => a -> b -> a
- pattern (:<) :: Cons b b a a => a -> b -> b
- pattern Strict :: Strict s t => t -> s
- pattern Lazy :: Strict t s => t -> s
- pattern Wrapped :: Rewrapped s s => Unwrapped s -> s
- pattern List :: IsList l => [Item l] -> l
- pattern Reversed :: Reversing t => t -> t
- pattern Swapped :: Swap p => p b a -> p a b
- pattern Unwrapped :: Rewrapped t t => t -> Unwrapped t
- lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
- strict :: Strict lazy strict => Iso' lazy strict
- index :: (Indexable i p, Eq i, Applicative f) => i -> Optical' p (Indexed i) f a a
- lazy :: Strict lazy strict => Iso' strict lazy
- uncons :: Cons s s a a => s -> Maybe (a, s)
- from :: AnIso s t a b -> Iso b a t s
- to :: (Profunctor p, Contravariant f) => (s -> a) -> Optic' p f s a
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- (&) :: a -> (a -> b) -> b
- (<|) :: Cons s s a a => a -> s -> s
- cons :: Cons s s a a => a -> s -> s
- snoc :: Snoc s s a a => s -> a -> s
- unsnoc :: Snoc s s a a => s -> Maybe (s, a)
- over :: ASetter s t a b -> (a -> b) -> s -> t
- (|>) :: Snoc s s a a => s -> a -> s
- lastOf :: Getting (Rightmost a) s a -> s -> Maybe a
- firstOf :: Getting (Leftmost a) s a -> s -> Maybe a
- traverse1Of_ :: Functor f => Getting (TraversedF r f) s a -> (a -> f r) -> s -> f ()
- traverseOf_ :: Functor f => Getting (Traversed r f) s a -> (a -> f r) -> s -> f ()
- cloneLens :: ALens s t a b -> Lens s t a b
- taking :: (Conjoined p, Applicative f) => Int -> Traversing p f s t a a -> Over p f s t a a
- traversed :: forall (f :: Type -> Type) a b. Traversable f => IndexedTraversal Int (f a) (f b) a b
- foldMapOf :: Getting r s a -> (a -> r) -> s -> r
- re :: AReview t b -> Getter b t
- review :: MonadReader b m => AReview t b -> m t
- preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a)
- (^?) :: s -> Getting (First a) s a -> Maybe a
- matching :: APrism s t a b -> s -> Either t a
- lengthOf :: Getting (Endo (Endo Int)) s a -> s -> Int
- prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b
- set :: ASetter s t a b -> b -> s -> t
- view :: MonadReader s m => Getting a s a -> m a
- cloneTraversal :: ATraversal s t a b -> Traversal s t a b
- use :: MonadState s m => Getting a s a -> m a
- (^.) :: s -> Getting a s a -> a
- (.~) :: ASetter s t a b -> b -> s -> t
- (%~) :: ASetter s t a b -> (a -> b) -> s -> t
- (+~) :: Num a => ASetter s t a a -> a -> s -> t
- (-~) :: Num a => ASetter s t a a -> a -> s -> t
- (*~) :: Num a => ASetter s t a a -> a -> s -> t
- (//~) :: Fractional a => ASetter s t a a -> a -> s -> t
- (^~) :: (Num a, Integral e) => ASetter s t a a -> e -> s -> t
- (^^~) :: (Fractional a, Integral e) => ASetter s t a a -> e -> s -> t
- (**~) :: Floating a => ASetter s t a a -> a -> s -> t
- (||~) :: ASetter s t Bool Bool -> Bool -> s -> t
- (&&~) :: ASetter s t Bool Bool -> Bool -> s -> t
- (?~) :: ASetter s t a (Maybe b) -> b -> s -> t
- (<>~) :: Semigroup a => ASetter s t a a -> a -> s -> t
- (%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()
- (+=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m ()
- (-=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m ()
- (*=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m ()
- (//=) :: (MonadState s m, Fractional a) => ASetter' s a -> a -> m ()
- (^=) :: (MonadState s m, Num a, Integral e) => ASetter' s a -> e -> m ()
- (^^=) :: (MonadState s m, Fractional a, Integral e) => ASetter' s a -> e -> m ()
- (**=) :: (MonadState s m, Floating a) => ASetter' s a -> a -> m ()
- (||=) :: MonadState s m => ASetter' s Bool -> Bool -> m ()
- (&&=) :: MonadState s m => ASetter' s Bool -> Bool -> m ()
- (.=) :: MonadState s m => ASetter s s a b -> b -> m ()
- (?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m ()
- (<>=) :: (MonadState s m, Semigroup a) => ASetter' s a -> a -> m ()
- (%@~) :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t
- withIndex :: (Indexable i p, Functor f) => p (i, s) (f (j, t)) -> Indexed i s (f t)
- (<.~) :: ASetter s t a b -> b -> s -> (b, t)
- (<.=) :: MonadState s m => ASetter s s a b -> b -> m b
- anyOf :: Getting Any s a -> (a -> Bool) -> s -> Bool
- ifoldMapOf :: IndexedGetting i m s a -> (i -> a -> m) -> s -> m
- dropping :: (Conjoined p, Applicative f) => Int -> Over p (Indexing f) s t a a -> Over p f s t a a
- traverseOf :: LensLike f s t a b -> (a -> f b) -> s -> f t
- _Left :: forall a c b p f. (Choice p, Applicative f) => p a (f b) -> p (Either a c) (f (Either b c))
- forOf :: LensLike f s t a b -> s -> (a -> f b) -> f t
- itraverseOf :: (Indexed i a (f b) -> s -> f t) -> (i -> a -> f b) -> s -> f t
- imapMOf :: Over (Indexed i) (WrappedMonad m) s t a b -> (i -> a -> m b) -> s -> m t
- iforMOf :: (Indexed i a (WrappedMonad m b) -> s -> WrappedMonad m t) -> s -> (i -> a -> m b) -> m t
- ifor :: (TraversableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f (t b)
- contextsOf :: ATraversal' a a -> a -> [Context a a a]
- ala :: (Functor f, Rewrapping s t) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s)
- alaf :: (Functor f, Functor g, Rewrapping s t) => (Unwrapped s -> s) -> (f t -> g s) -> f (Unwrapped t) -> g (Unwrapped s)
- folded :: forall (f :: Type -> Type) a. Foldable f => IndexedFold Int (f a) a
- alongside :: LensLike (AlongsideLeft f b') s t a b -> LensLike (AlongsideRight f t) s' t' a' b' -> LensLike f (s, s') (t, t') (a, a') (b, b')
- without :: APrism s t a b -> APrism u v c d -> Prism (Either s u) (Either t v) (Either a c) (Either b d)
- failing :: (Conjoined p, Applicative f) => Traversing p f s t a b -> Over p f s t a b -> Over p f s t a b
- imapM :: (TraversableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m (t b)
- iforM :: (TraversableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m (t b)
- imapAccumR :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b)
- imapAccumL :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b)
- iany :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool
- iall :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool
- inone :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool
- itraverse_ :: (FoldableWithIndex i t, Applicative f) => (i -> a -> f b) -> t a -> f ()
- ifor_ :: (FoldableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f ()
- imapM_ :: (FoldableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m ()
- iforM_ :: (FoldableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m ()
- iconcatMap :: FoldableWithIndex i f => (i -> a -> [b]) -> f a -> [b]
- ifind :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Maybe (i, a)
- ifoldrM :: (FoldableWithIndex i f, Monad m) => (i -> a -> b -> m b) -> b -> f a -> m b
- ifoldlM :: (FoldableWithIndex i f, Monad m) => (i -> b -> a -> m b) -> b -> f a -> m b
- itoList :: FoldableWithIndex i f => f a -> [(i, a)]
- foldBy :: Foldable t => (a -> a -> a) -> a -> t a -> a
- foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r
- traverseBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> t a -> f (t b)
- sequenceBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> t (f a) -> f (t a)
- indexing :: Indexable Int p => ((a -> Indexing f b) -> s -> Indexing f t) -> p a (f b) -> s -> f t
- indexing64 :: Indexable Int64 p => ((a -> Indexing64 f b) -> s -> Indexing64 f t) -> p a (f b) -> s -> f t
- asIndex :: (Indexable i p, Contravariant f, Functor f) => p i (f i) -> Indexed i s (f s)
- retagged :: (Profunctor p, Bifunctor p) => p a b -> p s b
- mapped :: forall (f :: Type -> Type) a b. Functor f => Setter (f a) (f b) a b
- lifted :: forall (m :: Type -> Type) a b. Monad m => Setter (m a) (m b) a b
- contramapped :: forall (f :: Type -> Type) b a. Contravariant f => Setter (f b) (f a) a b
- setting :: ((a -> b) -> s -> t) -> IndexPreservingSetter s t a b
- sets :: (Profunctor p, Profunctor q, Settable f) => (p a b -> q s t) -> Optical p q f s t a b
- cloneSetter :: ASetter s t a b -> Setter s t a b
- cloneIndexPreservingSetter :: ASetter s t a b -> IndexPreservingSetter s t a b
- cloneIndexedSetter :: AnIndexedSetter i s t a b -> IndexedSetter i s t a b
- set' :: ASetter' s a -> a -> s -> s
- (<?~) :: ASetter s t a (Maybe b) -> b -> s -> (b, t)
- assign :: MonadState s m => ASetter s s a b -> b -> m ()
- modifying :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()
- (<~) :: MonadState s m => ASetter s s a b -> m b -> m ()
- (<?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m b
- scribe :: (MonadWriter t m, Monoid s) => ASetter s t a b -> b -> m ()
- passing :: MonadWriter w m => Setter w w u v -> m (a, u -> v) -> m a
- ipassing :: MonadWriter w m => IndexedSetter i w w u v -> m (a, i -> u -> v) -> m a
- censoring :: MonadWriter w m => Setter w w u v -> (u -> v) -> m a -> m a
- icensoring :: MonadWriter w m => IndexedSetter i w w u v -> (i -> u -> v) -> m a -> m a
- locally :: MonadReader s m => ASetter s s a b -> (a -> b) -> m r -> m r
- ilocally :: MonadReader s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m r -> m r
- iover :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t
- iset :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t
- isets :: ((i -> a -> b) -> s -> t) -> IndexedSetter i s t a b
- (.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t
- (%@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m ()
- imodifying :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m ()
- (.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m ()
- assignA :: Arrow p => ASetter s t a b -> p s b -> p s t
- mapOf :: ASetter s t a b -> (a -> b) -> s -> t
- imapOf :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t
- withLens :: forall s t a b (rep :: RuntimeRep) (r :: TYPE rep). ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
- iplens :: (s -> a) -> (s -> b -> t) -> IndexPreservingLens s t a b
- ilens :: (s -> (i, a)) -> (s -> b -> t) -> IndexedLens i s t a b
- (&~) :: s -> State s a -> s
- (%%~) :: forall {k} f s (t :: k) a (b :: k). LensLike f s t a b -> (a -> f b) -> s -> f t
- (%%=) :: forall {k} s m p r (a :: k) b. MonadState s m => Over p ((,) r) s s a b -> p a (r, b) -> m r
- (??) :: Functor f => f (a -> b) -> a -> f b
- choosing :: Functor f => LensLike f s t a b -> LensLike f s' t' a b -> LensLike f (Either s s') (Either t t') a b
- chosen :: forall a b p f. (Conjoined p, Functor f) => p a (f b) -> p (Either a a) (f (Either b b))
- locus :: forall (p :: Type -> Type -> Type -> Type) a c s b. IndexedComonadStore p => Lens (p a c s) (p b c s) a b
- cloneIndexPreservingLens :: ALens s t a b -> IndexPreservingLens s t a b
- cloneIndexedLens :: AnIndexedLens i s t a b -> IndexedLens i s t a b
- (<%~) :: LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
- (<+~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t)
- (<-~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t)
- (<*~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t)
- (<//~) :: Fractional a => LensLike ((,) a) s t a a -> a -> s -> (a, t)
- (<^~) :: (Num a, Integral e) => LensLike ((,) a) s t a a -> e -> s -> (a, t)
- (<^^~) :: (Fractional a, Integral e) => LensLike ((,) a) s t a a -> e -> s -> (a, t)
- (<**~) :: Floating a => LensLike ((,) a) s t a a -> a -> s -> (a, t)
- (<||~) :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t)
- (<&&~) :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t)
- (<<%~) :: LensLike ((,) a) s t a b -> (a -> b) -> s -> (a, t)
- (<<.~) :: LensLike ((,) a) s t a b -> b -> s -> (a, t)
- (<<?~) :: LensLike ((,) a) s t a (Maybe b) -> b -> s -> (a, t)
- (<<+~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s)
- (<<-~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s)
- (<<*~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s)
- (<<//~) :: Fractional a => LensLike' ((,) a) s a -> a -> s -> (a, s)
- (<<^~) :: (Num a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s)
- (<<^^~) :: (Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s)
- (<<**~) :: Floating a => LensLike' ((,) a) s a -> a -> s -> (a, s)
- (<<||~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s)
- (<<&&~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s)
- (<<<>~) :: Semigroup r => LensLike' ((,) r) s r -> r -> s -> (r, s)
- (<%=) :: MonadState s m => LensLike ((,) b) s s a b -> (a -> b) -> m b
- (<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
- (<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
- (<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
- (<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a
- (<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a
- (<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a
- (<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a
- (<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool
- (<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool
- (<<%=) :: (Strong p, MonadState s m) => Over p ((,) a) s s a b -> p a b -> m a
- (<<.=) :: MonadState s m => LensLike ((,) a) s s a b -> b -> m a
- (<<?=) :: MonadState s m => LensLike ((,) a) s s a (Maybe b) -> b -> m a
- (<<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
- (<<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
- (<<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
- (<<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a
- (<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a
- (<<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a
- (<<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a
- (<<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool
- (<<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool
- (<<<>=) :: (MonadState s m, Semigroup r) => LensLike' ((,) r) s r -> r -> m r
- (<<~) :: MonadState s m => ALens s s a b -> m b -> m b
- (<<>~) :: Semigroup m => LensLike ((,) m) s t m m -> m -> s -> (m, t)
- (<<>=) :: (MonadState s m, Semigroup r) => LensLike' ((,) r) s r -> r -> m r
- overA :: Arrow ar => LensLike (Context a b) s t a b -> ar a b -> ar s t
- (<%@~) :: Over (Indexed i) ((,) b) s t a b -> (i -> a -> b) -> s -> (b, t)
- (<<%@~) :: Over (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t)
- (%%@~) :: forall {k1} i f s (t :: k1) a (b :: k1). Over (Indexed i) f s t a b -> (i -> a -> f b) -> s -> f t
- (%%@=) :: MonadState s m => Over (Indexed i) ((,) r) s s a b -> (i -> a -> (r, b)) -> m r
- (<%@=) :: MonadState s m => Over (Indexed i) ((,) b) s s a b -> (i -> a -> b) -> m b
- (<<%@=) :: MonadState s m => Over (Indexed i) ((,) a) s s a b -> (i -> a -> b) -> m a
- (^#) :: s -> ALens s t a b -> a
- storing :: ALens s t a b -> b -> s -> t
- (#~) :: ALens s t a b -> b -> s -> t
- (#%~) :: ALens s t a b -> (a -> b) -> s -> t
- (#%%~) :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t
- (#=) :: MonadState s m => ALens s s a b -> b -> m ()
- (#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m ()
- (<#%~) :: ALens s t a b -> (a -> b) -> s -> (b, t)
- (<#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m b
- (#%%=) :: MonadState s m => ALens s s a b -> (a -> (r, b)) -> m r
- (<#~) :: ALens s t a b -> b -> s -> (b, t)
- (<#=) :: MonadState s m => ALens s s a b -> b -> m b
- devoid :: forall {k} p f (a :: k) b. Over p f Void Void a b
- united :: forall a f. Functor f => (() -> f ()) -> a -> f a
- head1 :: forall (t :: Type -> Type) a. Traversable1 t => Lens' (t a) a
- last1 :: forall (t :: Type -> Type) a. Traversable1 t => Lens' (t a) a
- fusing :: Functor f => LensLike (Yoneda f) s t a b -> LensLike f s t a b
- _1' :: Field1 s t a b => Lens s t a b
- _2' :: Field2 s t a b => Lens s t a b
- _3' :: Field3 s t a b => Lens s t a b
- _4' :: Field4 s t a b => Lens s t a b
- _5' :: Field5 s t a b => Lens s t a b
- _6' :: Field6 s t a b => Lens s t a b
- _7' :: Field7 s t a b => Lens s t a b
- _8' :: Field8 s t a b => Lens s t a b
- _9' :: Field9 s t a b => Lens s t a b
- _10' :: Field10 s t a b => Lens s t a b
- _11' :: Field11 s t a b => Lens s t a b
- _12' :: Field12 s t a b => Lens s t a b
- _13' :: Field13 s t a b => Lens s t a b
- _14' :: Field14 s t a b => Lens s t a b
- _15' :: Field15 s t a b => Lens s t a b
- _16' :: Field16 s t a b => Lens s t a b
- _17' :: Field17 s t a b => Lens s t a b
- _18' :: Field18 s t a b => Lens s t a b
- _19' :: Field19 s t a b => Lens s t a b
- ito :: (Indexable i p, Contravariant f) => (s -> (i, a)) -> Over' p f s a
- like :: (Profunctor p, Contravariant f, Functor f) => a -> Optic' p f s a
- ilike :: (Indexable i p, Contravariant f, Functor f) => i -> a -> Over' p f s a
- views :: MonadReader s m => LensLike' (Const r :: Type -> Type) s a -> (a -> r) -> m r
- uses :: MonadState s m => LensLike' (Const r :: Type -> Type) s a -> (a -> r) -> m r
- listening :: MonadWriter w m => Getting u w u -> m a -> m (a, u)
- ilistening :: MonadWriter w m => IndexedGetting i (i, u) w u -> m a -> m (a, (i, u))
- listenings :: MonadWriter w m => Getting v w u -> (u -> v) -> m a -> m (a, v)
- ilistenings :: MonadWriter w m => IndexedGetting i v w u -> (i -> u -> v) -> m a -> m (a, v)
- iview :: MonadReader s m => IndexedGetting i (i, a) s a -> m (i, a)
- iviews :: MonadReader s m => IndexedGetting i r s a -> (i -> a -> r) -> m r
- iuse :: MonadState s m => IndexedGetting i (i, a) s a -> m (i, a)
- iuses :: MonadState s m => IndexedGetting i r s a -> (i -> a -> r) -> m r
- (^@.) :: s -> IndexedGetting i (i, a) s a -> (i, a)
- getting :: (Profunctor p, Profunctor q, Functor f, Contravariant f) => Optical p q f s t a b -> Optical' p q f s a
- unto :: (Profunctor p, Bifunctor p, Functor f) => (b -> t) -> Optic p f s t a b
- un :: (Profunctor p, Bifunctor p, Functor f) => Getting a s a -> Optic' p f a s
- reviews :: MonadReader b m => AReview t b -> (t -> r) -> m r
- reuse :: MonadState b m => AReview t b -> m t
- reuses :: MonadState b m => AReview t b -> (t -> r) -> m r
- reviewing :: (Bifunctor p, Functor f) => Optic (Tagged :: Type -> Type -> Type) Identity s t a b -> Optic' p f t b
- withPrism :: APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r
- clonePrism :: APrism s t a b -> Prism s t a b
- prism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b
- aside :: APrism s t a b -> Prism (e, s) (e, t) (e, a) (e, b)
- below :: forall (f :: Type -> Type) s a. Traversable f => APrism' s a -> Prism' (f s) (f a)
- isn't :: APrism s t a b -> s -> Bool
- matching' :: LensLike (Either a) s t a b -> s -> Either t a
- _Right :: forall c a b p f. (Choice p, Applicative f) => p a (f b) -> p (Either c a) (f (Either c b))
- _Just :: forall a b p f. (Choice p, Applicative f) => p a (f b) -> p (Maybe a) (f (Maybe b))
- _Nothing :: forall a p f. (Choice p, Applicative f) => p () (f ()) -> p (Maybe a) (f (Maybe a))
- _Void :: forall s a p f. (Choice p, Applicative f) => p a (f Void) -> p s (f s)
- only :: Eq a => a -> Prism' a ()
- nearly :: a -> (a -> Bool) -> Prism' a ()
- _Show :: (Read a, Show a) => Prism' String a
- folding :: Foldable f => (s -> f a) -> Fold s a
- ifolding :: (Foldable f, Indexable i p, Contravariant g, Applicative g) => (s -> f (i, a)) -> Over p g s t a b
- foldring :: (Contravariant f, Applicative f) => ((a -> f a -> f a) -> f a -> s -> f a) -> LensLike f s t a b
- ifoldring :: (Indexable i p, Contravariant f, Applicative f) => ((i -> a -> f a -> f a) -> f a -> s -> f a) -> Over p f s t a b
- folded64 :: forall (f :: Type -> Type) a. Foldable f => IndexedFold Int64 (f a) a
- repeated :: Apply f => LensLike' f a a
- replicated :: Int -> Fold a a
- cycled :: Apply f => LensLike f s t a b -> LensLike f s t a b
- unfolded :: (b -> Maybe (a, b)) -> Fold b a
- iterated :: Apply f => (a -> a) -> LensLike' f a a
- filtered :: (Choice p, Applicative f) => (a -> Bool) -> Optic' p f a a
- filteredBy :: (Indexable i p, Applicative f) => Getting (First i) a i -> p a (f a) -> a -> f a
- takingWhile :: (Conjoined p, Applicative f) => (a -> Bool) -> Over p (TakingWhile p f a a) s t a a -> Over p f s t a a
- droppingWhile :: (Conjoined p, Profunctor q, Applicative f) => (a -> Bool) -> Optical p q (Compose (State Bool) f) s t a a -> Optical p q f s t a a
- worded :: forall (f :: Type -> Type). Applicative f => IndexedLensLike' Int f String String
- lined :: forall (f :: Type -> Type). Applicative f => IndexedLensLike' Int f String String
- foldOf :: Getting a s a -> s -> a
- foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r
- foldlOf :: Getting (Dual (Endo r)) s a -> (r -> a -> r) -> r -> s -> r
- toListOf :: Getting (Endo [a]) s a -> s -> [a]
- toNonEmptyOf :: Getting (NonEmptyDList a) s a -> s -> NonEmpty a
- altOf :: Applicative f => Getting (Alt f a) s a -> s -> f a
- (^..) :: s -> Getting (Endo [a]) s a -> [a]
- andOf :: Getting All s Bool -> s -> Bool
- orOf :: Getting Any s Bool -> s -> Bool
- allOf :: Getting All s a -> (a -> Bool) -> s -> Bool
- noneOf :: Getting Any s a -> (a -> Bool) -> s -> Bool
- productOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a
- sumOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a
- forOf_ :: Functor f => Getting (Traversed r f) s a -> s -> (a -> f r) -> f ()
- sequenceAOf_ :: Functor f => Getting (Traversed a f) s (f a) -> s -> f ()
- for1Of_ :: Functor f => Getting (TraversedF r f) s a -> s -> (a -> f r) -> f ()
- sequence1Of_ :: Functor f => Getting (TraversedF a f) s (f a) -> s -> f ()
- mapMOf_ :: Monad m => Getting (Sequenced r m) s a -> (a -> m r) -> s -> m ()
- forMOf_ :: Monad m => Getting (Sequenced r m) s a -> s -> (a -> m r) -> m ()
- sequenceOf_ :: Monad m => Getting (Sequenced a m) s (m a) -> s -> m ()
- asumOf :: Alternative f => Getting (Endo (f a)) s (f a) -> s -> f a
- msumOf :: MonadPlus m => Getting (Endo (m a)) s (m a) -> s -> m a
- elemOf :: Eq a => Getting Any s a -> a -> s -> Bool
- notElemOf :: Eq a => Getting All s a -> a -> s -> Bool
- concatMapOf :: Getting [r] s a -> (a -> [r]) -> s -> [r]
- concatOf :: Getting [r] s [r] -> s -> [r]
- (^?!) :: HasCallStack => s -> Getting (Endo a) s a -> a
- first1Of :: Getting (First a) s a -> s -> a
- last1Of :: Getting (Last a) s a -> s -> a
- nullOf :: Getting All s a -> s -> Bool
- notNullOf :: Getting Any s a -> s -> Bool
- maximumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a
- maximum1Of :: Ord a => Getting (Max a) s a -> s -> a
- minimumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a
- minimum1Of :: Ord a => Getting (Min a) s a -> s -> a
- maximumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a
- minimumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a
- findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a
- findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a)
- lookupOf :: Eq k => Getting (Endo (Maybe v)) s (k, v) -> k -> s -> Maybe v
- foldr1Of :: HasCallStack => Getting (Endo (Maybe a)) s a -> (a -> a -> a) -> s -> a
- foldl1Of :: HasCallStack => Getting (Dual (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a
- foldrOf' :: Getting (Dual (Endo (Endo r))) s a -> (a -> r -> r) -> r -> s -> r
- foldlOf' :: Getting (Endo (Endo r)) s a -> (r -> a -> r) -> r -> s -> r
- foldr1Of' :: HasCallStack => Getting (Dual (Endo (Endo (Maybe a)))) s a -> (a -> a -> a) -> s -> a
- foldl1Of' :: HasCallStack => Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a
- foldrMOf :: Monad m => Getting (Dual (Endo (r -> m r))) s a -> (a -> r -> m r) -> r -> s -> m r
- foldlMOf :: Monad m => Getting (Endo (r -> m r)) s a -> (r -> a -> m r) -> r -> s -> m r
- has :: Getting Any s a -> s -> Bool
- hasn't :: Getting All s a -> s -> Bool
- pre :: Getting (First a) s a -> IndexPreservingGetter s (Maybe a)
- ipre :: IndexedGetting i (First (i, a)) s a -> IndexPreservingGetter s (Maybe (i, a))
- ipreview :: MonadReader s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a))
- previews :: MonadReader s m => Getting (First r) s a -> (a -> r) -> m (Maybe r)
- ipreviews :: MonadReader s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r)
- preuse :: MonadState s m => Getting (First a) s a -> m (Maybe a)
- ipreuse :: MonadState s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a))
- preuses :: MonadState s m => Getting (First r) s a -> (a -> r) -> m (Maybe r)
- ipreuses :: MonadState s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r)
- ifoldrOf :: IndexedGetting i (Endo r) s a -> (i -> a -> r -> r) -> r -> s -> r
- ifoldlOf :: IndexedGetting i (Dual (Endo r)) s a -> (i -> r -> a -> r) -> r -> s -> r
- ianyOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool
- iallOf :: IndexedGetting i All s a -> (i -> a -> Bool) -> s -> Bool
- inoneOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool
- itraverseOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> (i -> a -> f r) -> s -> f ()
- iforOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> s -> (i -> a -> f r) -> f ()
- imapMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> (i -> a -> m r) -> s -> m ()
- iforMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> s -> (i -> a -> m r) -> m ()
- iconcatMapOf :: IndexedGetting i [r] s a -> (i -> a -> [r]) -> s -> [r]
- ifindOf :: IndexedGetting i (Endo (Maybe a)) s a -> (i -> a -> Bool) -> s -> Maybe a
- ifindMOf :: Monad m => IndexedGetting i (Endo (m (Maybe a))) s a -> (i -> a -> m Bool) -> s -> m (Maybe a)
- ifoldrOf' :: IndexedGetting i (Dual (Endo (r -> r))) s a -> (i -> a -> r -> r) -> r -> s -> r
- ifoldlOf' :: IndexedGetting i (Endo (r -> r)) s a -> (i -> r -> a -> r) -> r -> s -> r
- ifoldrMOf :: Monad m => IndexedGetting i (Dual (Endo (r -> m r))) s a -> (i -> a -> r -> m r) -> r -> s -> m r
- ifoldlMOf :: Monad m => IndexedGetting i (Endo (r -> m r)) s a -> (i -> r -> a -> m r) -> r -> s -> m r
- itoListOf :: IndexedGetting i (Endo [(i, a)]) s a -> s -> [(i, a)]
- (^@..) :: s -> IndexedGetting i (Endo [(i, a)]) s a -> [(i, a)]
- (^@?) :: s -> IndexedGetting i (Endo (Maybe (i, a))) s a -> Maybe (i, a)
- (^@?!) :: HasCallStack => s -> IndexedGetting i (Endo (i, a)) s a -> (i, a)
- elemIndexOf :: Eq a => IndexedGetting i (First i) s a -> a -> s -> Maybe i
- elemIndicesOf :: Eq a => IndexedGetting i (Endo [i]) s a -> a -> s -> [i]
- findIndexOf :: IndexedGetting i (First i) s a -> (a -> Bool) -> s -> Maybe i
- findIndicesOf :: IndexedGetting i (Endo [i]) s a -> (a -> Bool) -> s -> [i]
- ifiltered :: (Indexable i p, Applicative f) => (i -> a -> Bool) -> Optical' p (Indexed i) f a a
- itakingWhile :: (Indexable i p, Profunctor q, Contravariant f, Applicative f) => (i -> a -> Bool) -> Optical' (Indexed i) q (Const (Endo (f s)) :: Type -> Type) s a -> Optical' p q f s a
- idroppingWhile :: (Indexable i p, Profunctor q, Applicative f) => (i -> a -> Bool) -> Optical (Indexed i) q (Compose (State Bool) f) s t a a -> Optical p q f s t a a
- foldByOf :: Fold s a -> (a -> a -> a) -> a -> s -> a
- foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r
- traversal :: ((a -> f b) -> s -> f t) -> LensLike f s t a b
- sequenceAOf :: LensLike f s t (f b) b -> s -> f t
- mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t
- forMOf :: LensLike (WrappedMonad m) s t a b -> s -> (a -> m b) -> m t
- sequenceOf :: LensLike (WrappedMonad m) s t (m b) b -> s -> m t
- transposeOf :: LensLike ZipList s t [a] a -> s -> [t]
- mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
- mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
- scanr1Of :: LensLike (Backwards (State (Maybe a))) s t a a -> (a -> a -> a) -> s -> t
- scanl1Of :: LensLike (State (Maybe a)) s t a a -> (a -> a -> a) -> s -> t
- loci :: forall a c s b f. Applicative f => (a -> f b) -> Bazaar (->) a c s -> f (Bazaar (->) b c s)
- iloci :: forall i a c s b p f. (Indexable i p, Applicative f) => p a (f b) -> Bazaar (Indexed i) a c s -> f (Bazaar (Indexed i) b c s)
- partsOf :: Functor f => Traversing (->) f s t a a -> LensLike f s t [a] [a]
- ipartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a a -> Over p f s t [a] [a]
- partsOf' :: ATraversal s t a a -> Lens s t [a] [a]
- ipartsOf' :: forall i p f s t a. (Indexable [i] p, Functor f) => Over (Indexed i) (Bazaar' (Indexed i) a) s t a a -> Over p f s t [a] [a]
- unsafePartsOf :: Functor f => Traversing (->) f s t a b -> LensLike f s t [a] [b]
- iunsafePartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a b -> Over p f s t [a] [b]
- unsafePartsOf' :: ATraversal s t a b -> Lens s t [a] [b]
- iunsafePartsOf' :: forall i s t a b. Over (Indexed i) (Bazaar (Indexed i) a b) s t a b -> IndexedLens [i] s t [a] [b]
- unsafeSingular :: (HasCallStack, Conjoined p, Functor f) => Traversing p f s t a b -> Over p f s t a b
- holesOf :: Conjoined p => Over p (Bazaar p a a) s t a a -> s -> [Pretext p a a t]
- holes1Of :: Conjoined p => Over p (Bazaar1 p a a) s t a a -> s -> NonEmpty (Pretext p a a t)
- both :: forall (r :: Type -> Type -> Type) a b. Bitraversable r => Traversal (r a a) (r b b) a b
- both1 :: forall (r :: Type -> Type -> Type) a b. Bitraversable1 r => Traversal1 (r a a) (r b b) a b
- cloneIndexPreservingTraversal :: ATraversal s t a b -> IndexPreservingTraversal s t a b
- cloneIndexedTraversal :: AnIndexedTraversal i s t a b -> IndexedTraversal i s t a b
- cloneTraversal1 :: ATraversal1 s t a b -> Traversal1 s t a b
- cloneIndexPreservingTraversal1 :: ATraversal1 s t a b -> IndexPreservingTraversal1 s t a b
- cloneIndexedTraversal1 :: AnIndexedTraversal1 i s t a b -> IndexedTraversal1 i s t a b
- iforOf :: (Indexed i a (f b) -> s -> f t) -> s -> (i -> a -> f b) -> f t
- imapAccumROf :: Over (Indexed i) (Backwards (State acc)) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
- imapAccumLOf :: Over (Indexed i) (State acc) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
- traversed1 :: forall (f :: Type -> Type) a b. Traversable1 f => IndexedTraversal1 Int (f a) (f b) a b
- traversed64 :: forall (f :: Type -> Type) a b. Traversable f => IndexedTraversal Int64 (f a) (f b) a b
- ignored :: Applicative f => pafb -> s -> f s
- elementOf :: forall (f :: Type -> Type) s t a. Applicative f => LensLike (Indexing f) s t a a -> Int -> IndexedLensLike Int f s t a a
- element :: forall (t :: Type -> Type) a. Traversable t => Int -> IndexedTraversal' Int (t a) a
- elementsOf :: forall (f :: Type -> Type) s t a. Applicative f => LensLike (Indexing f) s t a a -> (Int -> Bool) -> IndexedLensLike Int f s t a a
- elements :: forall (t :: Type -> Type) a. Traversable t => (Int -> Bool) -> IndexedTraversal' Int (t a) a
- failover :: Alternative m => LensLike ((,) Any) s t a b -> (a -> b) -> s -> m t
- ifailover :: Alternative m => Over (Indexed i) ((,) Any) s t a b -> (i -> a -> b) -> s -> m t
- deepOf :: (Conjoined p, Applicative f) => LensLike f s t s t -> Traversing p f s t a b -> Over p f s t a b
- confusing :: Applicative f => LensLike (Curried (Yoneda f) (Yoneda f)) s t a b -> LensLike f s t a b
- traverseByOf :: Traversal s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> s -> f t
- sequenceByOf :: Traversal s t (f b) b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> s -> f t
- ilevels :: forall (f :: Type -> Type) i s t a b j. Applicative f => Traversing (Indexed i) f s t a b -> IndexedLensLike Int f s t (Level i a) (Level j b)
- (<.) :: Indexable i p => (Indexed i s t -> r) -> ((a -> b) -> s -> t) -> p a b -> r
- selfIndex :: Indexable a p => p a fb -> a -> fb
- reindexed :: Indexable j p => (i -> j) -> (Indexed i a b -> r) -> p a b -> r
- icompose :: Indexable p c => (i -> j -> p) -> (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> c a b -> r
- imapped :: forall i (f :: Type -> Type) a b. FunctorWithIndex i f => IndexedSetter i (f a) (f b) a b
- ifolded :: forall i (f :: Type -> Type) a. FoldableWithIndex i f => IndexedFold i (f a) a
- itraversed :: forall i (t :: Type -> Type) a b. TraversableWithIndex i t => IndexedTraversal i (t a) (t b) a b
- ifoldMapBy :: FoldableWithIndex i t => (r -> r -> r) -> r -> (i -> a -> r) -> t a -> r
- ifoldMapByOf :: IndexedFold i t a -> (r -> r -> r) -> r -> (i -> a -> r) -> t -> r
- itraverseBy :: TraversableWithIndex i t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> t a -> f (t b)
- itraverseByOf :: IndexedTraversal i s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> s -> f t
- runEq :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2). AnEquality s t a b -> Identical s t a b
- substEq :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) (rep :: RuntimeRep) (r :: TYPE rep). AnEquality s t a b -> ((s ~ a, t ~ b) => r) -> r
- mapEq :: forall k1 k2 (s :: k1) (t :: k2) (a :: k1) (b :: k2) f. AnEquality s t a b -> f s -> f a
- fromEq :: forall {k2} {k1} (s :: k2) (t :: k1) (a :: k2) (b :: k1). AnEquality s t a b -> Equality b a t s
- simply :: forall {k} {k1} p (f :: k -> k1) (s :: k) (a :: k) (rep :: RuntimeRep) (r :: TYPE rep). (Optic' p f s a -> r) -> Optic' p f s a -> r
- simple :: forall {k2} (a :: k2) k3 p (f :: k2 -> k3). p a (f a) -> p a (f a)
- cloneEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2). AnEquality s t a b -> Equality s t a b
- equality :: forall {k1} {k2} (s :: k1) (a :: k1) (b :: k2) (t :: k2). (s :~: a) -> (b :~: t) -> Equality s t a b
- equality' :: forall {k2} (a :: k2) (b :: k2). (a :~: b) -> Equality' a b
- overEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) p. AnEquality s t a b -> p a b -> p s t
- underEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) p. AnEquality s t a b -> p t s -> p b a
- fromLeibniz :: forall {k1} {k2} (a :: k1) (b :: k2) (s :: k1) (t :: k2). (Identical a b a b -> Identical a b s t) -> Equality s t a b
- fromLeibniz' :: forall {k2} (s :: k2) (a :: k2). ((s :~: s) -> s :~: a) -> Equality' s a
- withEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) (rep :: RuntimeRep) (r :: TYPE rep). AnEquality s t a b -> ((s :~: a) -> (b :~: t) -> r) -> r
- iso :: (s -> a) -> (b -> t) -> Iso s t a b
- withIso :: forall s t a b (rep :: RuntimeRep) (r :: TYPE rep). AnIso s t a b -> ((s -> a) -> (b -> t) -> r) -> r
- cloneIso :: AnIso s t a b -> Iso s t a b
- au :: Functor f => AnIso s t a b -> ((b -> t) -> f s) -> f a
- auf :: (Functor f, Functor g) => AnIso s t a b -> (f t -> g s) -> f b -> g a
- xplat :: forall {k2} s g (t :: k2) a (b :: k2). Optic (Costar ((->) s)) g s t a b -> ((s -> a) -> g b) -> g t
- xplatf :: forall {k} {k2} f g (s :: k) (t :: k2) (a :: k) (b :: k2). Optic (Costar f) g s t a b -> (f a -> g b) -> f s -> g t
- under :: AnIso s t a b -> (t -> s) -> b -> a
- enum :: Enum a => Iso' Int a
- mapping :: forall (f :: Type -> Type) (g :: Type -> Type) s t a b. (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
- non :: Eq a => a -> Iso' (Maybe a) a
- non' :: APrism' a () -> Iso' (Maybe a) a
- anon :: a -> (a -> Bool) -> Iso' (Maybe a) a
- curried :: forall a b c d e f1 p f2. (Profunctor p, Functor f2) => p (a -> b -> c) (f2 (d -> e -> f1)) -> p ((a, b) -> c) (f2 ((d, e) -> f1))
- uncurried :: forall a b c d e f1 p f2. (Profunctor p, Functor f2) => p ((a, b) -> c) (f2 ((d, e) -> f1)) -> p (a -> b -> c) (f2 (d -> e -> f1))
- flipped :: forall a b c a' b' c' p f. (Profunctor p, Functor f) => p (b -> a -> c) (f (b' -> a' -> c')) -> p (a -> b -> c) (f (a' -> b' -> c'))
- swapped :: forall (p :: Type -> Type -> Type) a b c d. Swap p => Iso (p a b) (p c d) (p b a) (p d c)
- reversed :: Reversing a => Iso' a a
- involuted :: (a -> a) -> Iso' a a
- magma :: LensLike (Mafic a b) s t a b -> Iso s u (Magma Int t b a) (Magma j u c c)
- imagma :: Over (Indexed i) (Molten i a b) s t a b -> Iso s t' (Magma i t b a) (Magma j t' c c)
- contramapping :: forall (f :: Type -> Type) s t a b. Contravariant f => AnIso s t a b -> Iso (f a) (f b) (f s) (f t)
- dimapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b s' t' a' b'. (Profunctor p, Profunctor q) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (p a s') (q b t') (p s a') (q t b')
- lmapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b x y. (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p a x) (q b y) (p s x) (q t y)
- rmapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b x y. (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p x s) (q y t) (p x a) (q y b)
- bimapping :: forall (f :: Type -> Type -> Type) (g :: Type -> Type -> Type) s t a b s' t' a' b'. (Bifunctor f, Bifunctor g) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (f s s') (g t t') (f a a') (g b b')
- firsting :: forall (f :: Type -> Type -> Type) (g :: Type -> Type -> Type) s t a b x y. (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f s x) (g t y) (f a x) (g b y)
- seconding :: forall (f :: Type -> Type -> Type) (g :: Type -> Type -> Type) s t a b x y. (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f x s) (g y t) (f x a) (g y b)
- coerced :: forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
- _head :: Cons s s a a => Traversal' s a
- _tail :: Cons s s a a => Traversal' s s
- _init :: Snoc s s a a => Traversal' s s
- _last :: Snoc s s a a => Traversal' s a
- _GWrapped' :: forall s (d :: Meta) (c :: Meta) (s' :: Meta) a. (Generic s, D1 d (C1 c (S1 s' (Rec0 a))) ~ Rep s, Unwrapped s ~ GUnwrapped (Rep s)) => Iso' s (Unwrapped s)
- _Unwrapped' :: Wrapped s => Iso' (Unwrapped s) s
- _Wrapped :: Rewrapping s t => Iso s t (Unwrapped s) (Unwrapped t)
- _Unwrapped :: Rewrapping s t => Iso (Unwrapped t) (Unwrapped s) t s
- op :: Wrapped s => (Unwrapped s -> s) -> s -> Unwrapped s
- _Wrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' s (Unwrapped s)
- _Unwrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' (Unwrapped s) s
- _Wrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
- _Unwrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso (Unwrapped t) (Unwrapped s) t s
- deep :: (Conjoined p, Applicative f, Plated s) => Traversing p f s s a b -> Over p f s s a b
- rewrite :: Plated a => (a -> Maybe a) -> a -> a
- rewriteOf :: ASetter a b a b -> (b -> Maybe a) -> a -> b
- rewriteOn :: Plated a => ASetter s t a a -> (a -> Maybe a) -> s -> t
- rewriteOnOf :: ASetter s t a b -> ASetter a b a b -> (b -> Maybe a) -> s -> t
- rewriteM :: (Monad m, Plated a) => (a -> m (Maybe a)) -> a -> m a
- rewriteMOf :: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b
- rewriteMOn :: (Monad m, Plated a) => LensLike (WrappedMonad m) s t a a -> (a -> m (Maybe a)) -> s -> m t
- rewriteMOnOf :: Monad m => LensLike (WrappedMonad m) s t a b -> LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> s -> m t
- universe :: Plated a => a -> [a]
- universeOf :: Getting (Endo [a]) a a -> a -> [a]
- universeOn :: Plated a => Getting (Endo [a]) s a -> s -> [a]
- universeOnOf :: Getting (Endo [a]) s a -> Getting (Endo [a]) a a -> s -> [a]
- cosmos :: Plated a => Fold a a
- cosmosOf :: (Applicative f, Contravariant f) => LensLike' f a a -> LensLike' f a a
- cosmosOn :: (Applicative f, Contravariant f, Plated a) => LensLike' f s a -> LensLike' f s a
- cosmosOnOf :: (Applicative f, Contravariant f) => LensLike' f s a -> LensLike' f a a -> LensLike' f s a
- transformOn :: Plated a => ASetter s t a a -> (a -> a) -> s -> t
- transformOf :: ASetter a b a b -> (b -> b) -> a -> b
- transformOnOf :: ASetter s t a b -> ASetter a b a b -> (b -> b) -> s -> t
- transformM :: (Monad m, Plated a) => (a -> m a) -> a -> m a
- transformMOn :: (Monad m, Plated a) => LensLike (WrappedMonad m) s t a a -> (a -> m a) -> s -> m t
- transformMOf :: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b
- transformMOnOf :: Monad m => LensLike (WrappedMonad m) s t a b -> LensLike (WrappedMonad m) a b a b -> (b -> m b) -> s -> m t
- contexts :: Plated a => a -> [Context a a a]
- contextsOn :: Plated a => ATraversal s t a a -> s -> [Context a a t]
- contextsOnOf :: ATraversal s t a a -> ATraversal' a a -> s -> [Context a a t]
- holes :: Plated a => a -> [Pretext (->) a a a]
- holesOn :: Conjoined p => Over p (Bazaar p a a) s t a a -> s -> [Pretext p a a t]
- holesOnOf :: Conjoined p => LensLike (Bazaar p r r) s t a b -> Over p (Bazaar p r r) a b r r -> s -> [Pretext p r r t]
- paraOf :: Getting (Endo [a]) a a -> (a -> [r] -> r) -> a -> r
- para :: Plated a => (a -> [r] -> r) -> a -> r
- composOpFold :: Plated a => b -> (b -> b -> b) -> (a -> b) -> a -> b
- parts :: Plated a => Lens' a [a]
- gplate :: (Generic a, GPlated a (Rep a)) => Traversal' a a
- gplate1 :: forall {k} (f :: k -> Type) (a :: k). (Generic1 f, GPlated1 f (Rep1 f)) => Traversal' (f a) (f a)
- icontains :: Contains m => Index m -> IndexedLens' (Index m) m Bool
- iix :: Ixed m => Index m -> IndexedTraversal' (Index m) m (IxValue m)
- ixAt :: At m => Index m -> Traversal' m (IxValue m)
- sans :: At m => Index m -> m -> m
- iat :: At m => Index m -> IndexedLens' (Index m) m (Maybe (IxValue m))
- makePrisms :: Name -> DecsQ
- makeClassyPrisms :: Name -> DecsQ
- simpleLenses :: Lens' LensRules Bool
- generateSignatures :: Lens' LensRules Bool
- generateUpdateableOptics :: Lens' LensRules Bool
- generateLazyPatterns :: Lens' LensRules Bool
- generateRecordSyntax :: Lens' LensRules Bool
- createClass :: Lens' LensRules Bool
- lensField :: Lens' LensRules FieldNamer
- lensClass :: Lens' LensRules ClassyNamer
- lensRules :: LensRules
- underscoreNoPrefixNamer :: FieldNamer
- lensRulesFor :: [(String, String)] -> LensRules
- lookingupNamer :: [(String, String)] -> FieldNamer
- mappingNamer :: (String -> [String]) -> FieldNamer
- classyRules :: LensRules
- classyRules_ :: LensRules
- makeLenses :: Name -> DecsQ
- makeClassy :: Name -> DecsQ
- makeClassy_ :: Name -> DecsQ
- makeLensesFor :: [(String, String)] -> Name -> DecsQ
- makeClassyFor :: String -> String -> [(String, String)] -> Name -> DecsQ
- makeLensesWith :: LensRules -> Name -> DecsQ
- declareLenses :: DecsQ -> DecsQ
- declareLensesFor :: [(String, String)] -> DecsQ -> DecsQ
- declareClassy :: DecsQ -> DecsQ
- declareClassyFor :: [(String, (String, String))] -> [(String, String)] -> DecsQ -> DecsQ
- declarePrisms :: DecsQ -> DecsQ
- declareWrapped :: DecsQ -> DecsQ
- declareFields :: DecsQ -> DecsQ
- declareLensesWith :: LensRules -> DecsQ -> DecsQ
- makeWrapped :: Name -> DecsQ
- underscoreFields :: LensRules
- underscoreNamer :: FieldNamer
- camelCaseFields :: LensRules
- camelCaseNamer :: FieldNamer
- classUnderscoreNoPrefixFields :: LensRules
- classUnderscoreNoPrefixNamer :: FieldNamer
- abbreviatedFields :: LensRules
- abbreviatedNamer :: FieldNamer
- makeFields :: Name -> DecsQ
- makeFieldsNoPrefix :: Name -> DecsQ
- defaultFieldRules :: LensRules
- class Functor f => Applicative (f :: Type -> Type) where
  - pure :: a -> f a
  - (<*>) :: f (a -> b) -> f a -> f b
  - liftA2 :: (a -> b -> c) -> f a -> f b -> f c
  - (*>) :: f a -> f b -> f b
  - (<*) :: f a -> f b -> f a
- (*>) :: Applicative f => f a -> f b -> f b
- (<*) :: Applicative f => f a -> f b -> f a
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- (<$) :: Functor f => a -> f b -> f a
- liftA :: Applicative f => (a -> b) -> f a -> f b
- liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d

# Diagrams library

Exports from this library for working with diagrams.

module Diagrams

# Convenience re-exports from other packages

For working with default values. Diagrams also exports `with`, an alias for `def`.

module Data.Default.Class

For representing and operating on colors.

class ColourOps (f :: Type -> Type) where Source #

Minimal complete definition

over, darken

Methods

darken :: Num a => a -> f a -> f a Source #

`darken s c` blends a colour with black without changing it's opacity.

For `Colour`, `darken s c = blend s c mempty`

#### Instances

Instances details

ColourOps AlphaColour |
Instance details Defined in Data.Colour.Internal Methods over :: Num a => AlphaColour a -> AlphaColour a -> AlphaColour a Source # darken :: Num a => a -> AlphaColour a -> AlphaColour a Source #
ColourOps Colour |
Instance details Defined in Data.Colour.Internal Methods over :: Num a => AlphaColour a -> Colour a -> Colour a Source # darken :: Num a => a -> Colour a -> Colour a Source #

data AlphaColour a Source #

This type represents a `Colour` that may be semi-transparent.

The `Monoid` instance allows you to composite colours.

    x `mappend` y == x `over` y

To get the (pre-multiplied) colour channel of an `AlphaColour` `c`, simply composite `c` over black.

    c `over` black

#### Instances

Instances details

AffineSpace AlphaColour |
Instance details Defined in Data.Colour.Internal Methods affineCombo :: Num a => [(a, AlphaColour a)] -> AlphaColour a -> AlphaColour a Source #
ColourOps AlphaColour |
Instance details Defined in Data.Colour.Internal Methods over :: Num a => AlphaColour a -> AlphaColour a -> AlphaColour a Source # darken :: Num a => a -> AlphaColour a -> AlphaColour a Source #
Num a => Monoid (AlphaColour a) |
Instance details Defined in Data.Colour.Internal Methods mempty :: AlphaColour a Source # mappend :: AlphaColour a -> AlphaColour a -> AlphaColour a Source # mconcat :: [AlphaColour a] -> AlphaColour a Source #
Num a => Semigroup (AlphaColour a) | `AlphaColour` forms a monoid with `over` and `transparent`.
Instance details Defined in Data.Colour.Internal Methods (<>) :: AlphaColour a -> AlphaColour a -> AlphaColour a Source # sconcat :: NonEmpty (AlphaColour a) -> AlphaColour a Source # stimes :: Integral b => b -> AlphaColour a -> AlphaColour a Source #
a ~ Double => Color (AlphaColour a) Source # |
Instance details Defined in Diagrams.Attributes Methods toAlphaColour :: AlphaColour a -> AlphaColour Double Source # fromAlphaColour :: AlphaColour Double -> AlphaColour a Source #
Parseable (AlphaColour Double) Source # | Parse ``AlphaColour` Double` as either a named color from Data.Colour.Names or a hexadecimal color.
Instance details Defined in Diagrams.Backend.CmdLine Methods parser :: Parser (AlphaColour Double) Source #
Eq a => Eq (AlphaColour a) |
Instance details Defined in Data.Colour.Internal Methods (==) :: AlphaColour a -> AlphaColour a -> Bool Source # (/=) :: AlphaColour a -> AlphaColour a -> Bool Source #

data Colour a Source #

This type represents the human preception of colour. The `a` parameter is a numeric type used internally for the representation.

The `Monoid` instance allows one to add colours, but beware that adding colours can take you out of gamut. Consider using `blend` whenever possible.

#### Instances

Instances details

AffineSpace Colour |
Instance details Defined in Data.Colour.Internal Methods affineCombo :: Num a => [(a, Colour a)] -> Colour a -> Colour a Source #
ColourOps Colour |
Instance details Defined in Data.Colour.Internal Methods over :: Num a => AlphaColour a -> Colour a -> Colour a Source # darken :: Num a => a -> Colour a -> Colour a Source #
Num a => Monoid (Colour a) |
Instance details Defined in Data.Colour.Internal Methods mempty :: Colour a Source # mappend :: Colour a -> Colour a -> Colour a Source # mconcat :: [Colour a] -> Colour a Source #
Num a => Semigroup (Colour a) |
Instance details Defined in Data.Colour.Internal Methods (<>) :: Colour a -> Colour a -> Colour a Source # sconcat :: NonEmpty (Colour a) -> Colour a Source # stimes :: Integral b => b -> Colour a -> Colour a Source #
a ~ Double => Color (Colour a) Source # |
Instance details Defined in Diagrams.Attributes Methods toAlphaColour :: Colour a -> AlphaColour Double Source # fromAlphaColour :: AlphaColour Double -> Colour a Source #
Parseable (Colour Double) Source # | Parse ``Colour` Double` as either a named color from Data.Colour.Names or a hexadecimal color.
Instance details Defined in Diagrams.Backend.CmdLine Methods parser :: Parser (Colour Double) Source #
Eq a => Eq (Colour a) |
Instance details Defined in Data.Colour.Internal Methods (==) :: Colour a -> Colour a -> Bool Source # (/=) :: Colour a -> Colour a -> Bool Source #

colourConvert :: (Fractional b, Real a) => Colour a -> Colour b Source #

Change the type used to represent the colour coordinates.

black :: Num a => Colour a Source #

transparent :: Num a => AlphaColour a Source #

This `AlphaColour` is entirely transparent and has no associated colour channel.

alphaColourConvert :: (Fractional b, Real a) => AlphaColour a -> AlphaColour b Source #

Change the type used to represent the colour coordinates.

opaque :: Num a => Colour a -> AlphaColour a Source #

Creates an opaque `AlphaColour` from a `Colour`.

dissolve :: Num a => a -> AlphaColour a -> AlphaColour a Source #

Returns an `AlphaColour` more transparent by a factor of `o`.

withOpacity :: Num a => Colour a -> a -> AlphaColour a Source #

Creates an `AlphaColour` from a `Colour` with a given opacity.

    c `withOpacity` o == dissolve o (opaque c)

blend :: (Num a, AffineSpace f) => a -> f a -> f a -> f a Source #

Compute the weighted average of two points. e.g.

    blend 0.4 a b = 0.4*a + 0.6*b

The weight can be negative, or greater than 1.0; however, be aware that non-convex combinations may lead to out of gamut colours.

alphaChannel :: AlphaColour a -> a Source #

Returns the opacity of an `AlphaColour`.

A large list of color names.

black :: Num a => Colour a Source #

readColourName :: (MonadFail m, Monad m, Ord a, Floating a) => String -> m (Colour a) Source #

aliceblue :: (Ord a, Floating a) => Colour a Source #

antiquewhite :: (Ord a, Floating a) => Colour a Source #

aqua :: (Ord a, Floating a) => Colour a Source #

aquamarine :: (Ord a, Floating a) => Colour a Source #

azure :: (Ord a, Floating a) => Colour a Source #

beige :: (Ord a, Floating a) => Colour a Source #

bisque :: (Ord a, Floating a) => Colour a Source #

blanchedalmond :: (Ord a, Floating a) => Colour a Source #

blue :: (Ord a, Floating a) => Colour a Source #

blueviolet :: (Ord a, Floating a) => Colour a Source #

brown :: (Ord a, Floating a) => Colour a Source #

burlywood :: (Ord a, Floating a) => Colour a Source #

cadetblue :: (Ord a, Floating a) => Colour a Source #

chartreuse :: (Ord a, Floating a) => Colour a Source #

chocolate :: (Ord a, Floating a) => Colour a Source #

coral :: (Ord a, Floating a) => Colour a Source #

cornflowerblue :: (Ord a, Floating a) => Colour a Source #

cornsilk :: (Ord a, Floating a) => Colour a Source #

crimson :: (Ord a, Floating a) => Colour a Source #

cyan :: (Ord a, Floating a) => Colour a Source #

darkblue :: (Ord a, Floating a) => Colour a Source #

darkcyan :: (Ord a, Floating a) => Colour a Source #

darkgoldenrod :: (Ord a, Floating a) => Colour a Source #

darkgray :: (Ord a, Floating a) => Colour a Source #

darkgreen :: (Ord a, Floating a) => Colour a Source #

darkgrey :: (Ord a, Floating a) => Colour a Source #

darkkhaki :: (Ord a, Floating a) => Colour a Source #

darkmagenta :: (Ord a, Floating a) => Colour a Source #

darkolivegreen :: (Ord a, Floating a) => Colour a Source #

darkorange :: (Ord a, Floating a) => Colour a Source #

darkorchid :: (Ord a, Floating a) => Colour a Source #

darkred :: (Ord a, Floating a) => Colour a Source #

darksalmon :: (Ord a, Floating a) => Colour a Source #

darkseagreen :: (Ord a, Floating a) => Colour a Source #

darkslateblue :: (Ord a, Floating a) => Colour a Source #

darkslategray :: (Ord a, Floating a) => Colour a Source #

darkslategrey :: (Ord a, Floating a) => Colour a Source #

darkturquoise :: (Ord a, Floating a) => Colour a Source #

darkviolet :: (Ord a, Floating a) => Colour a Source #

deeppink :: (Ord a, Floating a) => Colour a Source #

deepskyblue :: (Ord a, Floating a) => Colour a Source #

dimgray :: (Ord a, Floating a) => Colour a Source #

dimgrey :: (Ord a, Floating a) => Colour a Source #

dodgerblue :: (Ord a, Floating a) => Colour a Source #

firebrick :: (Ord a, Floating a) => Colour a Source #

floralwhite :: (Ord a, Floating a) => Colour a Source #

forestgreen :: (Ord a, Floating a) => Colour a Source #

fuchsia :: (Ord a, Floating a) => Colour a Source #

gainsboro :: (Ord a, Floating a) => Colour a Source #

ghostwhite :: (Ord a, Floating a) => Colour a Source #

gold :: (Ord a, Floating a) => Colour a Source #

goldenrod :: (Ord a, Floating a) => Colour a Source #

gray :: (Ord a, Floating a) => Colour a Source #

grey :: (Ord a, Floating a) => Colour a Source #

green :: (Ord a, Floating a) => Colour a Source #

greenyellow :: (Ord a, Floating a) => Colour a Source #

honeydew :: (Ord a, Floating a) => Colour a Source #

hotpink :: (Ord a, Floating a) => Colour a Source #

indianred :: (Ord a, Floating a) => Colour a Source #

indigo :: (Ord a, Floating a) => Colour a Source #

ivory :: (Ord a, Floating a) => Colour a Source #

khaki :: (Ord a, Floating a) => Colour a Source #

lavender :: (Ord a, Floating a) => Colour a Source #

lavenderblush :: (Ord a, Floating a) => Colour a Source #

lawngreen :: (Ord a, Floating a) => Colour a Source #

lemonchiffon :: (Ord a, Floating a) => Colour a Source #

lightblue :: (Ord a, Floating a) => Colour a Source #

lightcoral :: (Ord a, Floating a) => Colour a Source #

lightcyan :: (Ord a, Floating a) => Colour a Source #

lightgoldenrodyellow :: (Ord a, Floating a) => Colour a Source #

lightgray :: (Ord a, Floating a) => Colour a Source #

lightgreen :: (Ord a, Floating a) => Colour a Source #

lightgrey :: (Ord a, Floating a) => Colour a Source #

lightpink :: (Ord a, Floating a) => Colour a Source #

lightsalmon :: (Ord a, Floating a) => Colour a Source #

lightseagreen :: (Ord a, Floating a) => Colour a Source #

lightskyblue :: (Ord a, Floating a) => Colour a Source #

lightslategray :: (Ord a, Floating a) => Colour a Source #

lightslategrey :: (Ord a, Floating a) => Colour a Source #

lightsteelblue :: (Ord a, Floating a) => Colour a Source #

lightyellow :: (Ord a, Floating a) => Colour a Source #

lime :: (Ord a, Floating a) => Colour a Source #

limegreen :: (Ord a, Floating a) => Colour a Source #

linen :: (Ord a, Floating a) => Colour a Source #

magenta :: (Ord a, Floating a) => Colour a Source #

maroon :: (Ord a, Floating a) => Colour a Source #

mediumaquamarine :: (Ord a, Floating a) => Colour a Source #

mediumblue :: (Ord a, Floating a) => Colour a Source #

mediumorchid :: (Ord a, Floating a) => Colour a Source #

mediumpurple :: (Ord a, Floating a) => Colour a Source #

mediumseagreen :: (Ord a, Floating a) => Colour a Source #

mediumslateblue :: (Ord a, Floating a) => Colour a Source #

mediumspringgreen :: (Ord a, Floating a) => Colour a Source #

mediumturquoise :: (Ord a, Floating a) => Colour a Source #

mediumvioletred :: (Ord a, Floating a) => Colour a Source #

midnightblue :: (Ord a, Floating a) => Colour a Source #

mintcream :: (Ord a, Floating a) => Colour a Source #

mistyrose :: (Ord a, Floating a) => Colour a Source #

moccasin :: (Ord a, Floating a) => Colour a Source #

navajowhite :: (Ord a, Floating a) => Colour a Source #

navy :: (Ord a, Floating a) => Colour a Source #

oldlace :: (Ord a, Floating a) => Colour a Source #

olive :: (Ord a, Floating a) => Colour a Source #

olivedrab :: (Ord a, Floating a) => Colour a Source #

orange :: (Ord a, Floating a) => Colour a Source #

orangered :: (Ord a, Floating a) => Colour a Source #

orchid :: (Ord a, Floating a) => Colour a Source #

palegoldenrod :: (Ord a, Floating a) => Colour a Source #

palegreen :: (Ord a, Floating a) => Colour a Source #

paleturquoise :: (Ord a, Floating a) => Colour a Source #

palevioletred :: (Ord a, Floating a) => Colour a Source #

papayawhip :: (Ord a, Floating a) => Colour a Source #

peachpuff :: (Ord a, Floating a) => Colour a Source #

peru :: (Ord a, Floating a) => Colour a Source #

pink :: (Ord a, Floating a) => Colour a Source #

plum :: (Ord a, Floating a) => Colour a Source #

powderblue :: (Ord a, Floating a) => Colour a Source #

purple :: (Ord a, Floating a) => Colour a Source #

red :: (Ord a, Floating a) => Colour a Source #

rosybrown :: (Ord a, Floating a) => Colour a Source #

royalblue :: (Ord a, Floating a) => Colour a Source #

saddlebrown :: (Ord a, Floating a) => Colour a Source #

salmon :: (Ord a, Floating a) => Colour a Source #

sandybrown :: (Ord a, Floating a) => Colour a Source #

seagreen :: (Ord a, Floating a) => Colour a Source #

seashell :: (Ord a, Floating a) => Colour a Source #

sienna :: (Ord a, Floating a) => Colour a Source #

silver :: (Ord a, Floating a) => Colour a Source #

skyblue :: (Ord a, Floating a) => Colour a Source #

slateblue :: (Ord a, Floating a) => Colour a Source #

slategray :: (Ord a, Floating a) => Colour a Source #

slategrey :: (Ord a, Floating a) => Colour a Source #

snow :: (Ord a, Floating a) => Colour a Source #

springgreen :: (Ord a, Floating a) => Colour a Source #

steelblue :: (Ord a, Floating a) => Colour a Source #

teal :: (Ord a, Floating a) => Colour a Source #

thistle :: (Ord a, Floating a) => Colour a Source #

tomato :: (Ord a, Floating a) => Colour a Source #

turquoise :: (Ord a, Floating a) => Colour a Source #

violet :: (Ord a, Floating a) => Colour a Source #

wheat :: (Ord a, Floating a) => Colour a Source #

white :: (Ord a, Floating a) => Colour a Source #

whitesmoke :: (Ord a, Floating a) => Colour a Source #

yellow :: (Ord a, Floating a) => Colour a Source #

yellowgreen :: (Ord a, Floating a) => Colour a Source #

Specify your own colours.

module Data.Colour.SRGB

Semigroups and monoids show up all over the place, so things from Data.Semigroup and Data.Monoid often come in handy.

module Data.Semigroup

For computing with vectors.

module Linear.Vector

For computing with points and vectors.

module Linear.Affine

For computing with dot products and norm.

module Linear.Metric

For working with `Active` (i.e. animated) things.

module Data.Active

Most of the lens package. The following functions are not exported from lens because they either conflict with diagrams or may conflict with other libraries:

- `at`
- `contains`
- `.>`
- `<.>`
- `index`
- `indices`
- `none`
- `coerce`
- `indexed`
- `inside`
- `levels`
- `...`
- `children`
- `transform`
- `outside`
- `argument`
- `beside`
- `singular`

type Traversal s t a b = forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t Source #

A `Traversal` can be used directly as a `Setter` or a `Fold` (but not as a `Lens`) and provides the ability to both read and update multiple fields, subject to some relatively weak `Traversal` laws.

These have also been known as multilenses, but they have the signature and spirit of

    traverse :: Traversable f => Traversal (f a) (f b) a b

and the more evocative name suggests their application.

Most of the time the `Traversal` you will want to use is just `traverse`, but you can also pass any `Lens` or `Iso` as a `Traversal`, and composition of a `Traversal` (or `Lens` or `Iso`) with a `Traversal` (or `Lens` or `Iso`) using (`.`) forms a valid `Traversal`.

The laws for a `Traversal` `t` follow from the laws for `Traversable` as stated in "The Essence of the Iterator Pattern".

    t pure ≡ pure
    fmap (t f) . t g ≡ getCompose . t (Compose . fmap f . g)

One consequence of this requirement is that a `Traversal` needs to leave the same number of elements as a candidate for subsequent `Traversal` that it started with. Another testament to the strength of these laws is that the caveat expressed in section 5.5 of the "Essence of the Iterator Pattern" about exotic `Traversable` instances that `traverse` the same entry multiple times was actually already ruled out by the second law in that same paper!

type Fold s a = forall (f :: Type -> Type). (Contravariant f, Applicative f) => (a -> f a) -> s -> f s Source #

A `Fold` describes how to retrieve multiple values in a way that can be composed with other `LensLike` constructions.

A ``Fold` s a` provides a structure with operations very similar to those of the `Foldable` typeclass, see `foldMapOf` and the other `Fold` combinators.

By convention, if there exists a `foo` method that expects a ``Foldable` (f a)`, then there should be a `fooOf` method that takes a ``Fold` s a` and a value of type `s`.

A `Getter` is a legal `Fold` that just ignores the supplied `Monoid`.

Unlike a `Traversal` a `Fold` is read-only. Since a `Fold` cannot be used to write back there are no `Lens` laws that apply.

class Contravariant (f :: Type -> Type) where Source #

The class of contravariant functors.

Whereas in Haskell, one can think of a `Functor` as containing or producing values, a contravariant functor is a functor that can be thought of as consuming values.

As an example, consider the type of predicate functions `a -> Bool`. One such predicate might be `negative x = x < 0`, which classifies integers as to whether they are negative. However, given this predicate, we can re-use it in other situations, providing we have a way to map values to integers. For instance, we can use the `negative` predicate on a person's bank balance to work out if they are currently overdrawn:

    newtype Predicate a = Predicate { getPredicate :: a -> Bool }

    instance Contravariant Predicate where
      contramap :: (a' -> a) -> (Predicate a -> Predicate a')
      contramap f (Predicate p) = Predicate (p . f)
                                             |   `- First, map the input...
                                             `----- then apply the predicate.

    overdrawn :: Predicate Person
    overdrawn = contramap personBankBalance negative

Any instance should be subject to the following laws:

Identity
  ``contramap` `id` = `id``
Composition
  ``contramap` (g . f) = `contramap` f . `contramap` g`

Note, that the second law follows from the free theorem of the type of `contramap` and the first law, so you need only check that the former condition holds.

Minimal complete definition

contramap

Methods

contramap :: (a' -> a) -> f a -> f a' Source #

(>$) :: b -> f b -> f a infixl 4 Source #

Replace all locations in the output with the same value. The default definition is ``contramap` . `const``, but this may be overridden with a more efficient version.

#### Instances

Instances details

Contravariant Comparison | A `Comparison` is a `Contravariant` `Functor`, because `contramap` can apply its function argument to each input of the comparison function.
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Comparison a -> Comparison a' Source # (>$) :: b -> Comparison b -> Comparison a Source #
Contravariant Equivalence | Equivalence relations are `Contravariant`, because you can apply the contramapped function to each input to the equivalence relation.
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Equivalence a -> Equivalence a' Source # (>$) :: b -> Equivalence b -> Equivalence a Source #

Contravariant Predicate

A `Predicate` is a `Contravariant` `Functor`, because `contramap` can apply its function argument to the input of the predicate.

Without newtypes ``contramap` f` equals precomposing with `f` (= `(. f)`).

    contramap :: (a' -> a) -> (Predicate a -> Predicate a')
    contramap f (Predicate g) = Predicate (g . f)

Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Predicate a -> Predicate a' Source # (>$) :: b -> Predicate b -> Predicate a Source #
Contravariant (Op a) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a0) -> Op a a0 -> Op a a' Source # (>$) :: b -> Op a b -> Op a a0 Source #
Contravariant (Proxy :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Proxy a -> Proxy a' Source # (>$) :: b -> Proxy b -> Proxy a Source #
Contravariant (U1 :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> U1 a -> U1 a' Source # (>$) :: b -> U1 b -> U1 a Source #
Contravariant (V1 :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> V1 a -> V1 a' Source # (>$) :: b -> V1 b -> V1 a Source #
Contravariant f => Contravariant (Indexing f) |
Instance details Defined in Control.Lens.Internal.Indexed Methods contramap :: (a' -> a) -> Indexing f a -> Indexing f a' Source # (>$) :: b -> Indexing f b -> Indexing f a Source #
Contravariant f => Contravariant (Indexing64 f) |
Instance details Defined in Control.Lens.Internal.Indexed Methods contramap :: (a' -> a) -> Indexing64 f a -> Indexing64 f a' Source # (>$) :: b -> Indexing64 f b -> Indexing64 f a Source #
Contravariant m => Contravariant (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods contramap :: (a' -> a) -> MaybeT m a -> MaybeT m a' Source # (>$) :: b -> MaybeT m b -> MaybeT m a Source #
Contravariant (Const a :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a0) -> Const a a0 -> Const a a' Source # (>$) :: b -> Const a b -> Const a a0 Source #
Contravariant f => Contravariant (Alt f) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Alt f a -> Alt f a' Source # (>$) :: b -> Alt f b -> Alt f a Source #
Contravariant f => Contravariant (Rec1 f) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Rec1 f a -> Rec1 f a' Source # (>$) :: b -> Rec1 f b -> Rec1 f a Source #
Contravariant f => Contravariant (AlongsideLeft f b) |
Instance details Defined in Control.Lens.Internal.Getter Methods contramap :: (a' -> a) -> AlongsideLeft f b a -> AlongsideLeft f b a' Source # (>$) :: b0 -> AlongsideLeft f b b0 -> AlongsideLeft f b a Source #
Contravariant f => Contravariant (AlongsideRight f a) |
Instance details Defined in Control.Lens.Internal.Getter Methods contramap :: (a' -> a0) -> AlongsideRight f a a0 -> AlongsideRight f a a' Source # (>$) :: b -> AlongsideRight f a b -> AlongsideRight f a a0 Source #
Contravariant f => Contravariant (Backwards f) | Derived instance.
Instance details Defined in Control.Applicative.Backwards Methods contramap :: (a' -> a) -> Backwards f a -> Backwards f a' Source # (>$) :: b -> Backwards f b -> Backwards f a Source #
Contravariant m => Contravariant (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods contramap :: (a' -> a) -> ErrorT e m a -> ErrorT e m a' Source # (>$) :: b -> ErrorT e m b -> ErrorT e m a Source #
Contravariant m => Contravariant (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods contramap :: (a' -> a) -> ExceptT e m a -> ExceptT e m a' Source # (>$) :: b -> ExceptT e m b -> ExceptT e m a Source #
Contravariant m => Contravariant (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods contramap :: (a' -> a) -> ReaderT r m a -> ReaderT r m a' Source # (>$) :: b -> ReaderT r m b -> ReaderT r m a Source #
Contravariant m => Contravariant (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods contramap :: (a' -> a) -> StateT s m a -> StateT s m a' Source # (>$) :: b -> StateT s m b -> StateT s m a Source #
(Contravariant f, Contravariant g) => Contravariant (Product f g) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Product f g a -> Product f g a' Source # (>$) :: b -> Product f g b -> Product f g a Source #
(Contravariant f, Contravariant g) => Contravariant (Sum f g) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Sum f g a -> Sum f g a' Source # (>$) :: b -> Sum f g b -> Sum f g a Source #
(Contravariant f, Contravariant g) => Contravariant (f :*: g) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> (f :*: g) a -> (f :*: g) a' Source # (>$) :: b -> (f :*: g) b -> (f :*: g) a Source #
(Contravariant f, Contravariant g) => Contravariant (f :+: g) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> (f :+: g) a -> (f :+: g) a' Source # (>$) :: b -> (f :+: g) b -> (f :+: g) a Source #
Contravariant (K1 i c :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> K1 i c a -> K1 i c a' Source # (>$) :: b -> K1 i c b -> K1 i c a Source #
Contravariant (Forget r a :: Type -> Type) |
Instance details Defined in Data.Profunctor.Types Methods contramap :: (a' -> a0) -> Forget r a a0 -> Forget r a a' Source # (>$) :: b -> Forget r a b -> Forget r a a0 Source #
Contravariant f => Contravariant (Star f a) |
Instance details Defined in Data.Profunctor.Types Methods contramap :: (a' -> a0) -> Star f a a0 -> Star f a a' Source # (>$) :: b -> Star f a b -> Star f a a0 Source #
(Functor f, Contravariant g) => Contravariant (Compose f g) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> Compose f g a -> Compose f g a' Source # (>$) :: b -> Compose f g b -> Compose f g a Source #
(Functor f, Contravariant g) => Contravariant (f :.: g) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> (f :.: g) a -> (f :.: g) a' Source # (>$) :: b -> (f :.: g) b -> (f :.: g) a Source #
Contravariant f => Contravariant (M1 i c f) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a) -> M1 i c f a -> M1 i c f a' Source # (>$) :: b -> M1 i c f b -> M1 i c f a Source #
(Profunctor p, Contravariant g) => Contravariant (BazaarT p g a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods contramap :: (a' -> a0) -> BazaarT p g a b a0 -> BazaarT p g a b a' Source # (>$) :: b0 -> BazaarT p g a b b0 -> BazaarT p g a b a0 Source #
(Profunctor p, Contravariant g) => Contravariant (BazaarT1 p g a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods contramap :: (a' -> a0) -> BazaarT1 p g a b a0 -> BazaarT1 p g a b a' Source # (>$) :: b0 -> BazaarT1 p g a b b0 -> BazaarT1 p g a b a0 Source #
(Profunctor p, Contravariant g) => Contravariant (PretextT p g a b) |
Instance details Defined in Control.Lens.Internal.Context Methods contramap :: (a' -> a0) -> PretextT p g a b a0 -> PretextT p g a b a' Source # (>$) :: b0 -> PretextT p g a b b0 -> PretextT p g a b a0 Source #
Contravariant f => Contravariant (TakingWhile p f a b) |
Instance details Defined in Control.Lens.Internal.Magma Methods contramap :: (a' -> a0) -> TakingWhile p f a b a0 -> TakingWhile p f a b a' Source # (>$) :: b0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

class Bifunctor (p :: Type -> Type -> Type) where Source #

A bifunctor is a type constructor that takes two type arguments and is a functor in both arguments. That is, unlike with `Functor`, a type constructor such as `Either` does not need to be partially applied for a `Bifunctor` instance, and the methods in this class permit mapping functions over the `Left` value or the `Right` value, or both at the same time.

Formally, the class `Bifunctor` represents a bifunctor from `Hask` -> `Hask`.

Intuitively it is a bifunctor where both the first and second arguments are covariant.

You can define a `Bifunctor` by either defining `bimap` or by defining both `first` and `second`.

If you supply `bimap`, you should ensure that:

    bimap id id ≡ id

If you supply `first` and `second`, ensure:

    first id ≡ id
    second id ≡ id

If you supply both, you should also ensure:

    bimap f g ≡ first f . second g

These ensure by parametricity:

    bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
    first  (f . g) ≡ first  f . first  g
    second (f . g) ≡ second f . second g

Since: base-4.8.0.0

Minimal complete definition

bimap | first, second

Methods

bimap :: (a -> b) -> (c -> d) -> p a c -> p b d Source #

Map over both arguments at the same time.

    bimap f g ≡ first f . second g

#### Examples

Expand

    >>> bimap toUpper (+1) ('j', 3)
    ('J',4)

    >>> bimap toUpper (+1) (Left 'j')
    Left 'J'

    >>> bimap toUpper (+1) (Right 3)
    Right 4

#### Instances

Instances details

Bifunctor Either | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d Source # first :: (a -> b) -> Either a c -> Either b c Source # second :: (b -> c) -> Either a b -> Either a c Source #
Bifunctor Arg | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d Source # first :: (a -> b) -> Arg a c -> Arg b c Source # second :: (b -> c) -> Arg a b -> Arg a c Source #
Bifunctor Either |
Instance details Defined in Data.Strict.Either Methods bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d Source # first :: (a -> b) -> Either a c -> Either b c Source # second :: (b -> c) -> Either a b -> Either a c Source #
Bifunctor These |
Instance details Defined in Data.Strict.These Methods bimap :: (a -> b) -> (c -> d) -> These a c -> These b d Source # first :: (a -> b) -> These a c -> These b c Source # second :: (b -> c) -> These a b -> These a c Source #
Bifunctor Pair |
Instance details Defined in Data.Strict.Tuple Methods bimap :: (a -> b) -> (c -> d) -> Pair a c -> Pair b d Source # first :: (a -> b) -> Pair a c -> Pair b c Source # second :: (b -> c) -> Pair a b -> Pair a c Source #
Bifunctor These |
Instance details Defined in Data.These Methods bimap :: (a -> b) -> (c -> d) -> These a c -> These b d Source # first :: (a -> b) -> These a c -> These b c Source # second :: (b -> c) -> These a b -> These a c Source #
Bifunctor (,) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) Source # first :: (a -> b) -> (a, c) -> (b, c) Source # second :: (b -> c) -> (a, b) -> (a, c) Source #
Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d Source # first :: (a -> b) -> Const a c -> Const b c Source # second :: (b -> c) -> Const a b -> Const a c Source #
Functor f => Bifunctor (CofreeF f) |
Instance details Defined in Control.Comonad.Trans.Cofree Methods bimap :: (a -> b) -> (c -> d) -> CofreeF f a c -> CofreeF f b d Source # first :: (a -> b) -> CofreeF f a c -> CofreeF f b c Source # second :: (b -> c) -> CofreeF f a b -> CofreeF f a c Source #
Functor f => Bifunctor (FreeF f) |
Instance details Defined in Control.Monad.Trans.Free Methods bimap :: (a -> b) -> (c -> d) -> FreeF f a c -> FreeF f b d Source # first :: (a -> b) -> FreeF f a c -> FreeF f b c Source # second :: (b -> c) -> FreeF f a b -> FreeF f a c Source #
Functor f => Bifunctor (AlongsideLeft f) |
Instance details Defined in Control.Lens.Internal.Getter Methods bimap :: (a -> b) -> (c -> d) -> AlongsideLeft f a c -> AlongsideLeft f b d Source # first :: (a -> b) -> AlongsideLeft f a c -> AlongsideLeft f b c Source # second :: (b -> c) -> AlongsideLeft f a b -> AlongsideLeft f a c Source #
Functor f => Bifunctor (AlongsideRight f) |
Instance details Defined in Control.Lens.Internal.Getter Methods bimap :: (a -> b) -> (c -> d) -> AlongsideRight f a c -> AlongsideRight f b d Source # first :: (a -> b) -> AlongsideRight f a c -> AlongsideRight f b c Source # second :: (b -> c) -> AlongsideRight f a b -> AlongsideRight f a c Source #
Bifunctor (Tagged :: Type -> Type -> Type) |
Instance details Defined in Data.Tagged Methods bimap :: (a -> b) -> (c -> d) -> Tagged a c -> Tagged b d Source # first :: (a -> b) -> Tagged a c -> Tagged b c Source # second :: (b -> c) -> Tagged a b -> Tagged a c Source #
Bifunctor ((,,) x1) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, a, c) -> (x1, b, d) Source # first :: (a -> b) -> (x1, a, c) -> (x1, b, c) Source # second :: (b -> c) -> (x1, a, b) -> (x1, a, c) Source #
Bifunctor (K1 i :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> K1 i a c -> K1 i b d Source # first :: (a -> b) -> K1 i a c -> K1 i b c Source # second :: (b -> c) -> K1 i a b -> K1 i a c Source #
Bifunctor ((,,,) x1 x2) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, a, c) -> (x1, x2, b, d) Source # first :: (a -> b) -> (x1, x2, a, c) -> (x1, x2, b, c) Source # second :: (b -> c) -> (x1, x2, a, b) -> (x1, x2, a, c) Source #
Functor f => Bifunctor (Clown f :: Type -> Type -> Type) |
Instance details Defined in Data.Bifunctor.Clown Methods bimap :: (a -> b) -> (c -> d) -> Clown f a c -> Clown f b d Source # first :: (a -> b) -> Clown f a c -> Clown f b c Source # second :: (b -> c) -> Clown f a b -> Clown f a c Source #
Bifunctor p => Bifunctor (Flip p) |
Instance details Defined in Data.Bifunctor.Flip Methods bimap :: (a -> b) -> (c -> d) -> Flip p a c -> Flip p b d Source # first :: (a -> b) -> Flip p a c -> Flip p b c Source # second :: (b -> c) -> Flip p a b -> Flip p a c Source #
Functor g => Bifunctor (Joker g :: Type -> Type -> Type) |
Instance details Defined in Data.Bifunctor.Joker Methods bimap :: (a -> b) -> (c -> d) -> Joker g a c -> Joker g b d Source # first :: (a -> b) -> Joker g a c -> Joker g b c Source # second :: (b -> c) -> Joker g a b -> Joker g a c Source #
Bifunctor p => Bifunctor (WrappedBifunctor p) |
Instance details Defined in Data.Bifunctor.Wrapped Methods bimap :: (a -> b) -> (c -> d) -> WrappedBifunctor p a c -> WrappedBifunctor p b d Source # first :: (a -> b) -> WrappedBifunctor p a c -> WrappedBifunctor p b c Source # second :: (b -> c) -> WrappedBifunctor p a b -> WrappedBifunctor p a c Source #
Bifunctor ((,,,,) x1 x2 x3) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, d) Source # first :: (a -> b) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, c) Source # second :: (b -> c) -> (x1, x2, x3, a, b) -> (x1, x2, x3, a, c) Source #
(Bifunctor f, Bifunctor g) => Bifunctor (Product f g) |
Instance details Defined in Data.Bifunctor.Product Methods bimap :: (a -> b) -> (c -> d) -> Product f g a c -> Product f g b d Source # first :: (a -> b) -> Product f g a c -> Product f g b c Source # second :: (b -> c) -> Product f g a b -> Product f g a c Source #
(Bifunctor p, Bifunctor q) => Bifunctor (Sum p q) |
Instance details Defined in Data.Bifunctor.Sum Methods bimap :: (a -> b) -> (c -> d) -> Sum p q a c -> Sum p q b d Source # first :: (a -> b) -> Sum p q a c -> Sum p q b c Source # second :: (b -> c) -> Sum p q a b -> Sum p q a c Source #
Bifunctor ((,,,,,) x1 x2 x3 x4) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, d) Source # first :: (a -> b) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, c) Source # second :: (b -> c) -> (x1, x2, x3, x4, a, b) -> (x1, x2, x3, x4, a, c) Source #
(Functor f, Bifunctor p) => Bifunctor (Tannen f p) |
Instance details Defined in Data.Bifunctor.Tannen Methods bimap :: (a -> b) -> (c -> d) -> Tannen f p a c -> Tannen f p b d Source # first :: (a -> b) -> Tannen f p a c -> Tannen f p b c Source # second :: (b -> c) -> Tannen f p a b -> Tannen f p a c Source #
Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, d) Source # first :: (a -> b) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, c) Source # second :: (b -> c) -> (x1, x2, x3, x4, x5, a, b) -> (x1, x2, x3, x4, x5, a, c) Source #
(Bifunctor p, Functor f, Functor g) => Bifunctor (Biff p f g) |
Instance details Defined in Data.Bifunctor.Biff Methods bimap :: (a -> b) -> (c -> d) -> Biff p f g a c -> Biff p f g b d Source # first :: (a -> b) -> Biff p f g a c -> Biff p f g b c Source # second :: (b -> c) -> Biff p f g a b -> Biff p f g a c Source #

class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where Source #

Functors representing data structures that can be transformed to structures of the same shape by performing an `Applicative` (or, therefore, `Monad`) action on each element from left to right.

A more detailed description of what same shape means, the various methods, how traversals are constructed, and example advanced use-cases can be found in the Overview section of Data.Traversable.

For the class laws see the Laws section of Data.Traversable.

Minimal complete definition

traverse | sequenceA

Methods

traverse :: Applicative f => (a -> f b) -> t a -> f (t b) Source #

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see `traverse_`.

#### Examples

Expand

Basic usage:

In the first two examples we show each evaluated action mapping to the output structure.

    >>> traverse Just [1,2,3,4]
    Just [1,2,3,4]

    >>> traverse id [Right 1, Right 2, Right 3, Right 4]
    Right [1,2,3,4]

In the next examples, we show that `Nothing` and `Left` values short circuit the created structure.

    >>> traverse (const Nothing) [1,2,3,4]
    Nothing

    >>> traverse (\x -> if odd x then Just x else Nothing)  [1,2,3,4]
    Nothing

    >>> traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]
    Left 0

#### Instances

Instances details

Traversable ZipList | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) Source # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) Source # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) Source # sequence :: Monad m => ZipList (m a) -> m (ZipList a) Source #
Traversable Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) Source # sequenceA :: Applicative f => Complex (f a) -> f (Complex a) Source # mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) Source # sequence :: Monad m => Complex (m a) -> m (Complex a) Source #
Traversable Identity | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) Source # sequenceA :: Applicative f => Identity (f a) -> f (Identity a) Source # mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) Source # sequence :: Monad m => Identity (m a) -> m (Identity a) Source #
Traversable First | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) Source # sequenceA :: Applicative f => First (f a) -> f (First a) Source # mapM :: Monad m => (a -> m b) -> First a -> m (First b) Source # sequence :: Monad m => First (m a) -> m (First a) Source #
Traversable Last | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) Source # sequenceA :: Applicative f => Last (f a) -> f (Last a) Source # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) Source # sequence :: Monad m => Last (m a) -> m (Last a) Source #
Traversable Down | Since: base-4.12.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Down a -> f (Down b) Source # sequenceA :: Applicative f => Down (f a) -> f (Down a) Source # mapM :: Monad m => (a -> m b) -> Down a -> m (Down b) Source # sequence :: Monad m => Down (m a) -> m (Down a) Source #
Traversable First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) Source # sequenceA :: Applicative f => First (f a) -> f (First a) Source # mapM :: Monad m => (a -> m b) -> First a -> m (First b) Source # sequence :: Monad m => First (m a) -> m (First a) Source #
Traversable Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) Source # sequenceA :: Applicative f => Last (f a) -> f (Last a) Source # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) Source # sequence :: Monad m => Last (m a) -> m (Last a) Source #
Traversable Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) Source # sequenceA :: Applicative f => Max (f a) -> f (Max a) Source # mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) Source # sequence :: Monad m => Max (m a) -> m (Max a) Source #
Traversable Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) Source # sequenceA :: Applicative f => Min (f a) -> f (Min a) Source # mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) Source # sequence :: Monad m => Min (m a) -> m (Min a) Source #
Traversable Dual | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) Source # sequenceA :: Applicative f => Dual (f a) -> f (Dual a) Source # mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) Source # sequence :: Monad m => Dual (m a) -> m (Dual a) Source #
Traversable Product | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) Source # sequenceA :: Applicative f => Product (f a) -> f (Product a) Source # mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) Source # sequence :: Monad m => Product (m a) -> m (Product a) Source #
Traversable Sum | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) Source # sequenceA :: Applicative f => Sum (f a) -> f (Sum a) Source # mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) Source # sequence :: Monad m => Sum (m a) -> m (Sum a) Source #
Traversable Par1 | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) Source # sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) Source # mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) Source # sequence :: Monad m => Par1 (m a) -> m (Par1 a) Source #
Traversable IntMap | Traverses in order of increasing key.
Instance details Defined in Data.IntMap.Internal Methods traverse :: Applicative f => (a -> f b) -> IntMap a -> f (IntMap b) Source # sequenceA :: Applicative f => IntMap (f a) -> f (IntMap a) Source # mapM :: Monad m => (a -> m b) -> IntMap a -> m (IntMap b) Source # sequence :: Monad m => IntMap (m a) -> m (IntMap a) Source #
Traversable Digit |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> Digit a -> f (Digit b) Source # sequenceA :: Applicative f => Digit (f a) -> f (Digit a) Source # mapM :: Monad m => (a -> m b) -> Digit a -> m (Digit b) Source # sequence :: Monad m => Digit (m a) -> m (Digit a) Source #
Traversable Elem |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> Elem a -> f (Elem b) Source # sequenceA :: Applicative f => Elem (f a) -> f (Elem a) Source # mapM :: Monad m => (a -> m b) -> Elem a -> m (Elem b) Source # sequence :: Monad m => Elem (m a) -> m (Elem a) Source #
Traversable FingerTree |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> FingerTree a -> f (FingerTree b) Source # sequenceA :: Applicative f => FingerTree (f a) -> f (FingerTree a) Source # mapM :: Monad m => (a -> m b) -> FingerTree a -> m (FingerTree b) Source # sequence :: Monad m => FingerTree (m a) -> m (FingerTree a) Source #
Traversable Node |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> Node a -> f (Node b) Source # sequenceA :: Applicative f => Node (f a) -> f (Node a) Source # mapM :: Monad m => (a -> m b) -> Node a -> m (Node b) Source # sequence :: Monad m => Node (m a) -> m (Node a) Source #
Traversable Seq |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> Seq a -> f (Seq b) Source # sequenceA :: Applicative f => Seq (f a) -> f (Seq a) Source # mapM :: Monad m => (a -> m b) -> Seq a -> m (Seq b) Source # sequence :: Monad m => Seq (m a) -> m (Seq a) Source #
Traversable ViewL |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> ViewL a -> f (ViewL b) Source # sequenceA :: Applicative f => ViewL (f a) -> f (ViewL a) Source # mapM :: Monad m => (a -> m b) -> ViewL a -> m (ViewL b) Source # sequence :: Monad m => ViewL (m a) -> m (ViewL a) Source #
Traversable ViewR |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> ViewR a -> f (ViewR b) Source # sequenceA :: Applicative f => ViewR (f a) -> f (ViewR a) Source # mapM :: Monad m => (a -> m b) -> ViewR a -> m (ViewR b) Source # sequence :: Monad m => ViewR (m a) -> m (ViewR a) Source #
Traversable Tree |
Instance details Defined in Data.Tree Methods traverse :: Applicative f => (a -> f b) -> Tree a -> f (Tree b) Source # sequenceA :: Applicative f => Tree (f a) -> f (Tree a) Source # mapM :: Monad m => (a -> m b) -> Tree a -> m (Tree b) Source # sequence :: Monad m => Tree (m a) -> m (Tree a) Source #
Traversable Interval |
Instance details Defined in Numeric.Interval.Kaucher Methods traverse :: Applicative f => (a -> f b) -> Interval a -> f (Interval b) Source # sequenceA :: Applicative f => Interval (f a) -> f (Interval a) Source # mapM :: Monad m => (a -> m b) -> Interval a -> m (Interval b) Source # sequence :: Monad m => Interval (m a) -> m (Interval a) Source #
Traversable Plucker |
Instance details Defined in Linear.Plucker Methods traverse :: Applicative f => (a -> f b) -> Plucker a -> f (Plucker b) Source # sequenceA :: Applicative f => Plucker (f a) -> f (Plucker a) Source # mapM :: Monad m => (a -> m b) -> Plucker a -> m (Plucker b) Source # sequence :: Monad m => Plucker (m a) -> m (Plucker a) Source #
Traversable Quaternion |
Instance details Defined in Linear.Quaternion Methods traverse :: Applicative f => (a -> f b) -> Quaternion a -> f (Quaternion b) Source # sequenceA :: Applicative f => Quaternion (f a) -> f (Quaternion a) Source # mapM :: Monad m => (a -> m b) -> Quaternion a -> m (Quaternion b) Source # sequence :: Monad m => Quaternion (m a) -> m (Quaternion a) Source #
Traversable V0 |
Instance details Defined in Linear.V0 Methods traverse :: Applicative f => (a -> f b) -> V0 a -> f (V0 b) Source # sequenceA :: Applicative f => V0 (f a) -> f (V0 a) Source # mapM :: Monad m => (a -> m b) -> V0 a -> m (V0 b) Source # sequence :: Monad m => V0 (m a) -> m (V0 a) Source #
Traversable V1 |
Instance details Defined in Linear.V1 Methods traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) Source # sequenceA :: Applicative f => V1 (f a) -> f (V1 a) Source # mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) Source # sequence :: Monad m => V1 (m a) -> m (V1 a) Source #
Traversable V2 |
Instance details Defined in Linear.V2 Methods traverse :: Applicative f => (a -> f b) -> V2 a -> f (V2 b) Source # sequenceA :: Applicative f => V2 (f a) -> f (V2 a) Source # mapM :: Monad m => (a -> m b) -> V2 a -> m (V2 b) Source # sequence :: Monad m => V2 (m a) -> m (V2 a) Source #
Traversable V3 |
Instance details Defined in Linear.V3 Methods traverse :: Applicative f => (a -> f b) -> V3 a -> f (V3 b) Source # sequenceA :: Applicative f => V3 (f a) -> f (V3 a) Source # mapM :: Monad m => (a -> m b) -> V3 a -> m (V3 b) Source # sequence :: Monad m => V3 (m a) -> m (V3 a) Source #
Traversable V4 |
Instance details Defined in Linear.V4 Methods traverse :: Applicative f => (a -> f b) -> V4 a -> f (V4 b) Source # sequenceA :: Applicative f => V4 (f a) -> f (V4 a) Source # mapM :: Monad m => (a -> m b) -> V4 a -> m (V4 b) Source # sequence :: Monad m => V4 (m a) -> m (V4 a) Source #
Traversable Deletable |
Instance details Defined in Data.Monoid.Deletable Methods traverse :: Applicative f => (a -> f b) -> Deletable a -> f (Deletable b) Source # sequenceA :: Applicative f => Deletable (f a) -> f (Deletable a) Source # mapM :: Monad m => (a -> m b) -> Deletable a -> m (Deletable b) Source # sequence :: Monad m => Deletable (m a) -> m (Deletable a) Source #
Traversable Recommend |
Instance details Defined in Data.Monoid.Recommend Methods traverse :: Applicative f => (a -> f b) -> Recommend a -> f (Recommend b) Source # sequenceA :: Applicative f => Recommend (f a) -> f (Recommend a) Source # mapM :: Monad m => (a -> m b) -> Recommend a -> m (Recommend b) Source # sequence :: Monad m => Recommend (m a) -> m (Recommend a) Source #
Traversable Array |
Instance details Defined in Data.Primitive.Array Methods traverse :: Applicative f => (a -> f b) -> Array a -> f (Array b) Source # sequenceA :: Applicative f => Array (f a) -> f (Array a) Source # mapM :: Monad m => (a -> m b) -> Array a -> m (Array b) Source # sequence :: Monad m => Array (m a) -> m (Array a) Source #
Traversable SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods traverse :: Applicative f => (a -> f b) -> SmallArray a -> f (SmallArray b) Source # sequenceA :: Applicative f => SmallArray (f a) -> f (SmallArray a) Source # mapM :: Monad m => (a -> m b) -> SmallArray a -> m (SmallArray b) Source # sequence :: Monad m => SmallArray (m a) -> m (SmallArray a) Source #
Traversable Maybe |
Instance details Defined in Data.Strict.Maybe Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) Source # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) Source # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) Source # sequence :: Monad m => Maybe (m a) -> m (Maybe a) Source #
Traversable Vector |
Instance details Defined in Data.Vector Methods traverse :: Applicative f => (a -> f b) -> Vector a -> f (Vector b) Source # sequenceA :: Applicative f => Vector (f a) -> f (Vector a) Source # mapM :: Monad m => (a -> m b) -> Vector a -> m (Vector b) Source # sequence :: Monad m => Vector (m a) -> m (Vector a) Source #
Traversable NonEmpty | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) Source # sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) Source # mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) Source # sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) Source #
Traversable Maybe | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) Source # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) Source # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) Source # sequence :: Monad m => Maybe (m a) -> m (Maybe a) Source #
Traversable Solo | Since: base-4.15
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Solo a -> f (Solo b) Source # sequenceA :: Applicative f => Solo (f a) -> f (Solo a) Source # mapM :: Monad m => (a -> m b) -> Solo a -> m (Solo b) Source # sequence :: Monad m => Solo (m a) -> m (Solo a) Source #
Traversable [] | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> [a] -> f [b] Source # sequenceA :: Applicative f => [f a] -> f [a] Source # mapM :: Monad m => (a -> m b) -> [a] -> m [b] Source # sequence :: Monad m => [m a] -> m [a] Source #
Traversable (Either a) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) Source # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) Source # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) Source # sequence :: Monad m => Either a (m a0) -> m (Either a a0) Source #
Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) Source # sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) Source # mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) Source # sequence :: Monad m => Proxy (m a) -> m (Proxy a) Source #
Traversable (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) Source # sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) Source # mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) Source # sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) Source #
Ix i => Traversable (Array i) | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Array i a -> f (Array i b) Source # sequenceA :: Applicative f => Array i (f a) -> f (Array i a) Source # mapM :: Monad m => (a -> m b) -> Array i a -> m (Array i b) Source # sequence :: Monad m => Array i (m a) -> m (Array i a) Source #
Traversable (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) Source # sequenceA :: Applicative f => U1 (f a) -> f (U1 a) Source # mapM :: Monad m => (a -> m b) -> U1 a -> m (U1 b) Source # sequence :: Monad m => U1 (m a) -> m (U1 a) Source #
Traversable (UAddr :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UAddr a -> f (UAddr b) Source # sequenceA :: Applicative f => UAddr (f a) -> f (UAddr a) Source # mapM :: Monad m => (a -> m b) -> UAddr a -> m (UAddr b) Source # sequence :: Monad m => UAddr (m a) -> m (UAddr a) Source #
Traversable (UChar :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UChar a -> f (UChar b) Source # sequenceA :: Applicative f => UChar (f a) -> f (UChar a) Source # mapM :: Monad m => (a -> m b) -> UChar a -> m (UChar b) Source # sequence :: Monad m => UChar (m a) -> m (UChar a) Source #
Traversable (UDouble :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UDouble a -> f (UDouble b) Source # sequenceA :: Applicative f => UDouble (f a) -> f (UDouble a) Source # mapM :: Monad m => (a -> m b) -> UDouble a -> m (UDouble b) Source # sequence :: Monad m => UDouble (m a) -> m (UDouble a) Source #
Traversable (UFloat :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UFloat a -> f (UFloat b) Source # sequenceA :: Applicative f => UFloat (f a) -> f (UFloat a) Source # mapM :: Monad m => (a -> m b) -> UFloat a -> m (UFloat b) Source # sequence :: Monad m => UFloat (m a) -> m (UFloat a) Source #
Traversable (UInt :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UInt a -> f (UInt b) Source # sequenceA :: Applicative f => UInt (f a) -> f (UInt a) Source # mapM :: Monad m => (a -> m b) -> UInt a -> m (UInt b) Source # sequence :: Monad m => UInt (m a) -> m (UInt a) Source #
Traversable (UWord :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UWord a -> f (UWord b) Source # sequenceA :: Applicative f => UWord (f a) -> f (UWord a) Source # mapM :: Monad m => (a -> m b) -> UWord a -> m (UWord b) Source # sequence :: Monad m => UWord (m a) -> m (UWord a) Source #
Traversable (V1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) Source # sequenceA :: Applicative f => V1 (f a) -> f (V1 a) Source # mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) Source # sequence :: Monad m => V1 (m a) -> m (V1 a) Source #
Traversable (Map k) | Traverses in order of increasing key.
Instance details Defined in Data.Map.Internal Methods traverse :: Applicative f => (a -> f b) -> Map k a -> f (Map k b) Source # sequenceA :: Applicative f => Map k (f a) -> f (Map k a) Source # mapM :: Monad m => (a -> m b) -> Map k a -> m (Map k b) Source # sequence :: Monad m => Map k (m a) -> m (Map k a) Source #
Traversable f => Traversable (Cofree f) |
Instance details Defined in Control.Comonad.Cofree Methods traverse :: Applicative f0 => (a -> f0 b) -> Cofree f a -> f0 (Cofree f b) Source # sequenceA :: Applicative f0 => Cofree f (f0 a) -> f0 (Cofree f a) Source # mapM :: Monad m => (a -> m b) -> Cofree f a -> m (Cofree f b) Source # sequence :: Monad m => Cofree f (m a) -> m (Cofree f a) Source #
Traversable f => Traversable (Free f) |
Instance details Defined in Control.Monad.Free Methods traverse :: Applicative f0 => (a -> f0 b) -> Free f a -> f0 (Free f b) Source # sequenceA :: Applicative f0 => Free f (f0 a) -> f0 (Free f a) Source # mapM :: Monad m => (a -> m b) -> Free f a -> m (Free f b) Source # sequence :: Monad m => Free f (m a) -> m (Free f a) Source #
Traversable f => Traversable (Yoneda f) |
Instance details Defined in Data.Functor.Yoneda Methods traverse :: Applicative f0 => (a -> f0 b) -> Yoneda f a -> f0 (Yoneda f b) Source # sequenceA :: Applicative f0 => Yoneda f (f0 a) -> f0 (Yoneda f a) Source # mapM :: Monad m => (a -> m b) -> Yoneda f a -> m (Yoneda f b) Source # sequence :: Monad m => Yoneda f (m a) -> m (Yoneda f a) Source #
Traversable (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods traverse :: Applicative f => (a -> f b) -> Level i a -> f (Level i b) Source # sequenceA :: Applicative f => Level i (f a) -> f (Level i a) Source # mapM :: Monad m => (a -> m b) -> Level i a -> m (Level i b) Source # sequence :: Monad m => Level i (m a) -> m (Level i a) Source #
Traversable f => Traversable (Point f) |
Instance details Defined in Linear.Affine Methods traverse :: Applicative f0 => (a -> f0 b) -> Point f a -> f0 (Point f b) Source # sequenceA :: Applicative f0 => Point f (f0 a) -> f0 (Point f a) Source # mapM :: Monad m => (a -> m b) -> Point f a -> m (Point f b) Source # sequence :: Monad m => Point f (m a) -> m (Point f a) Source #
Traversable (Inf p) |
Instance details Defined in Data.Monoid.Inf Methods traverse :: Applicative f => (a -> f b) -> Inf p a -> f (Inf p b) Source # sequenceA :: Applicative f => Inf p (f a) -> f (Inf p a) Source # mapM :: Monad m => (a -> m b) -> Inf p a -> m (Inf p b) Source # sequence :: Monad m => Inf p (m a) -> m (Inf p a) Source #
Traversable (Either e) |
Instance details Defined in Data.Strict.Either Methods traverse :: Applicative f => (a -> f b) -> Either e a -> f (Either e b) Source # sequenceA :: Applicative f => Either e (f a) -> f (Either e a) Source # mapM :: Monad m => (a -> m b) -> Either e a -> m (Either e b) Source # sequence :: Monad m => Either e (m a) -> m (Either e a) Source #
Traversable (These a) |
Instance details Defined in Data.Strict.These Methods traverse :: Applicative f => (a0 -> f b) -> These a a0 -> f (These a b) Source # sequenceA :: Applicative f => These a (f a0) -> f (These a a0) Source # mapM :: Monad m => (a0 -> m b) -> These a a0 -> m (These a b) Source # sequence :: Monad m => These a (m a0) -> m (These a a0) Source #
Traversable (Pair e) |
Instance details Defined in Data.Strict.Tuple Methods traverse :: Applicative f => (a -> f b) -> Pair e a -> f (Pair e b) Source # sequenceA :: Applicative f => Pair e (f a) -> f (Pair e a) Source # mapM :: Monad m => (a -> m b) -> Pair e a -> m (Pair e b) Source # sequence :: Monad m => Pair e (m a) -> m (Pair e a) Source #
Traversable (These a) |
Instance details Defined in Data.These Methods traverse :: Applicative f => (a0 -> f b) -> These a a0 -> f (These a b) Source # sequenceA :: Applicative f => These a (f a0) -> f (These a a0) Source # mapM :: Monad m => (a0 -> m b) -> These a a0 -> m (These a b) Source # sequence :: Monad m => These a (m a0) -> m (These a a0) Source #
Traversable f => Traversable (MaybeT f) |
Instance details Defined in Control.Monad.Trans.Maybe Methods traverse :: Applicative f0 => (a -> f0 b) -> MaybeT f a -> f0 (MaybeT f b) Source # sequenceA :: Applicative f0 => MaybeT f (f0 a) -> f0 (MaybeT f a) Source # mapM :: Monad m => (a -> m b) -> MaybeT f a -> m (MaybeT f b) Source # sequence :: Monad m => MaybeT f (m a) -> m (MaybeT f a) Source #
Traversable (HashMap k) |
Instance details Defined in Data.HashMap.Internal Methods traverse :: Applicative f => (a -> f b) -> HashMap k a -> f (HashMap k b) Source # sequenceA :: Applicative f => HashMap k (f a) -> f (HashMap k a) Source # mapM :: Monad m => (a -> m b) -> HashMap k a -> m (HashMap k b) Source # sequence :: Monad m => HashMap k (m a) -> m (HashMap k a) Source #
Traversable ((,) a) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) Source # sequenceA :: Applicative f => (a, f a0) -> f (a, a0) Source # mapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) Source # sequence :: Monad m => (a, m a0) -> m (a, a0) Source #
Traversable (Const m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) Source # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) Source # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) Source # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) Source #
Traversable f => Traversable (Ap f) | Since: base-4.12.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> Ap f a -> f0 (Ap f b) Source # sequenceA :: Applicative f0 => Ap f (f0 a) -> f0 (Ap f a) Source # mapM :: Monad m => (a -> m b) -> Ap f a -> m (Ap f b) Source # sequence :: Monad m => Ap f (m a) -> m (Ap f a) Source #
Traversable f => Traversable (Alt f) | Since: base-4.12.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> Alt f a -> f0 (Alt f b) Source # sequenceA :: Applicative f0 => Alt f (f0 a) -> f0 (Alt f a) Source # mapM :: Monad m => (a -> m b) -> Alt f a -> m (Alt f b) Source # sequence :: Monad m => Alt f (m a) -> m (Alt f a) Source #
Traversable f => Traversable (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) Source # sequenceA :: Applicative f0 => Rec1 f (f0 a) -> f0 (Rec1 f a) Source # mapM :: Monad m => (a -> m b) -> Rec1 f a -> m (Rec1 f b) Source # sequence :: Monad m => Rec1 f (m a) -> m (Rec1 f a) Source #
Bitraversable p => Traversable (Fix p) |
Instance details Defined in Data.Bifunctor.Fix Methods traverse :: Applicative f => (a -> f b) -> Fix p a -> f (Fix p b) Source # sequenceA :: Applicative f => Fix p (f a) -> f (Fix p a) Source # mapM :: Monad m => (a -> m b) -> Fix p a -> m (Fix p b) Source # sequence :: Monad m => Fix p (m a) -> m (Fix p a) Source #
Bitraversable p => Traversable (Join p) |
Instance details Defined in Data.Bifunctor.Join Methods traverse :: Applicative f => (a -> f b) -> Join p a -> f (Join p b) Source # sequenceA :: Applicative f => Join p (f a) -> f (Join p a) Source # mapM :: Monad m => (a -> m b) -> Join p a -> m (Join p b) Source # sequence :: Monad m => Join p (m a) -> m (Join p a) Source #
Traversable f => Traversable (CofreeF f a) |
Instance details Defined in Control.Comonad.Trans.Cofree Methods traverse :: Applicative f0 => (a0 -> f0 b) -> CofreeF f a a0 -> f0 (CofreeF f a b) Source # sequenceA :: Applicative f0 => CofreeF f a (f0 a0) -> f0 (CofreeF f a a0) Source # mapM :: Monad m => (a0 -> m b) -> CofreeF f a a0 -> m (CofreeF f a b) Source # sequence :: Monad m => CofreeF f a (m a0) -> m (CofreeF f a a0) Source #
(Traversable f, Traversable w) => Traversable (CofreeT f w) |
Instance details Defined in Control.Comonad.Trans.Cofree Methods traverse :: Applicative f0 => (a -> f0 b) -> CofreeT f w a -> f0 (CofreeT f w b) Source # sequenceA :: Applicative f0 => CofreeT f w (f0 a) -> f0 (CofreeT f w a) Source # mapM :: Monad m => (a -> m b) -> CofreeT f w a -> m (CofreeT f w b) Source # sequence :: Monad m => CofreeT f w (m a) -> m (CofreeT f w a) Source #
Traversable f => Traversable (FreeF f a) |
Instance details Defined in Control.Monad.Trans.Free Methods traverse :: Applicative f0 => (a0 -> f0 b) -> FreeF f a a0 -> f0 (FreeF f a b) Source # sequenceA :: Applicative f0 => FreeF f a (f0 a0) -> f0 (FreeF f a a0) Source # mapM :: Monad m => (a0 -> m b) -> FreeF f a a0 -> m (FreeF f a b) Source # sequence :: Monad m => FreeF f a (m a0) -> m (FreeF f a a0) Source #
(Monad m, Traversable m, Traversable f) => Traversable (FreeT f m) |
Instance details Defined in Control.Monad.Trans.Free Methods traverse :: Applicative f0 => (a -> f0 b) -> FreeT f m a -> f0 (FreeT f m b) Source # sequenceA :: Applicative f0 => FreeT f m (f0 a) -> f0 (FreeT f m a) Source # mapM :: Monad m0 => (a -> m0 b) -> FreeT f m a -> m0 (FreeT f m b) Source # sequence :: Monad m0 => FreeT f m (m0 a) -> m0 (FreeT f m a) Source #
Traversable f => Traversable (AlongsideLeft f b) |

Instance details

Defined in Control.Lens.Internal.Getter

Methods

traverse :: Applicative f0 => (a -> f0 b0) -> AlongsideLeft f b a -> f0 (AlongsideLeft f b b0) Source #

sequenceA :: Applicative f0 => AlongsideLeft f b (f0 a) -> f0 (AlongsideLeft f b a) Source #

mapM :: Monad m => (a -> m b0) -> AlongsideLeft f b a -> m (AlongsideLeft f b b0) Source #

sequence :: Monad m => AlongsideLeft f b (m a) -> m (AlongsideLeft f b a) Source #

Traversable f => Traversable (AlongsideRight f a) |

Instance details

Defined in Control.Lens.Internal.Getter

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> AlongsideRight f a a0 -> f0 (AlongsideRight f a b) Source #

sequenceA :: Applicative f0 => AlongsideRight f a (f0 a0) -> f0 (AlongsideRight f a a0) Source #

mapM :: Monad m => (a0 -> m b) -> AlongsideRight f a a0 -> m (AlongsideRight f a b) Source #

sequence :: Monad m => AlongsideRight f a (m a0) -> m (AlongsideRight f a a0) Source #

Traversable (V n) |
Instance details Defined in Linear.V Methods traverse :: Applicative f => (a -> f b) -> V n a -> f (V n b) Source # sequenceA :: Applicative f => V n (f a) -> f (V n a) Source # mapM :: Monad m => (a -> m b) -> V n a -> m (V n b) Source # sequence :: Monad m => V n (m a) -> m (V n a) Source #
Traversable (Tagged s) |
Instance details Defined in Data.Tagged Methods traverse :: Applicative f => (a -> f b) -> Tagged s a -> f (Tagged s b) Source # sequenceA :: Applicative f => Tagged s (f a) -> f (Tagged s a) Source # mapM :: Monad m => (a -> m b) -> Tagged s a -> m (Tagged s b) Source # sequence :: Monad m => Tagged s (m a) -> m (Tagged s a) Source #
Traversable f => Traversable (Backwards f) | Derived instance.
Instance details Defined in Control.Applicative.Backwards Methods traverse :: Applicative f0 => (a -> f0 b) -> Backwards f a -> f0 (Backwards f b) Source # sequenceA :: Applicative f0 => Backwards f (f0 a) -> f0 (Backwards f a) Source # mapM :: Monad m => (a -> m b) -> Backwards f a -> m (Backwards f b) Source # sequence :: Monad m => Backwards f (m a) -> m (Backwards f a) Source #
Traversable f => Traversable (ErrorT e f) |
Instance details Defined in Control.Monad.Trans.Error Methods traverse :: Applicative f0 => (a -> f0 b) -> ErrorT e f a -> f0 (ErrorT e f b) Source # sequenceA :: Applicative f0 => ErrorT e f (f0 a) -> f0 (ErrorT e f a) Source # mapM :: Monad m => (a -> m b) -> ErrorT e f a -> m (ErrorT e f b) Source # sequence :: Monad m => ErrorT e f (m a) -> m (ErrorT e f a) Source #
Traversable f => Traversable (ExceptT e f) |
Instance details Defined in Control.Monad.Trans.Except Methods traverse :: Applicative f0 => (a -> f0 b) -> ExceptT e f a -> f0 (ExceptT e f b) Source # sequenceA :: Applicative f0 => ExceptT e f (f0 a) -> f0 (ExceptT e f a) Source # mapM :: Monad m => (a -> m b) -> ExceptT e f a -> m (ExceptT e f b) Source # sequence :: Monad m => ExceptT e f (m a) -> m (ExceptT e f a) Source #
(Traversable f, Traversable g) => Traversable (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods traverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) Source # sequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) Source # mapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) Source # sequence :: Monad m => Product f g (m a) -> m (Product f g a) Source #
(Traversable f, Traversable g) => Traversable (Sum f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods traverse :: Applicative f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) Source # sequenceA :: Applicative f0 => Sum f g (f0 a) -> f0 (Sum f g a) Source # mapM :: Monad m => (a -> m b) -> Sum f g a -> m (Sum f g b) Source # sequence :: Monad m => Sum f g (m a) -> m (Sum f g a) Source #
(Traversable f, Traversable g) => Traversable (f :*: g) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) Source # sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) Source # mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) Source # sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) Source #
(Traversable f, Traversable g) => Traversable (f :+: g) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) Source # sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) Source # mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) Source # sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) Source #
Traversable (K1 i c :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) Source # sequenceA :: Applicative f => K1 i c (f a) -> f (K1 i c a) Source # mapM :: Monad m => (a -> m b) -> K1 i c a -> m (K1 i c b) Source # sequence :: Monad m => K1 i c (m a) -> m (K1 i c a) Source #
Traversable (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods traverse :: Applicative f => (a -> f b0) -> Magma i t b a -> f (Magma i t b b0) Source # sequenceA :: Applicative f => Magma i t b (f a) -> f (Magma i t b a) Source # mapM :: Monad m => (a -> m b0) -> Magma i t b a -> m (Magma i t b b0) Source # sequence :: Monad m => Magma i t b (m a) -> m (Magma i t b a) Source #
Traversable (Forget r a :: Type -> Type) |
Instance details Defined in Data.Profunctor.Types Methods traverse :: Applicative f => (a0 -> f b) -> Forget r a a0 -> f (Forget r a b) Source # sequenceA :: Applicative f => Forget r a (f a0) -> f (Forget r a a0) Source # mapM :: Monad m => (a0 -> m b) -> Forget r a a0 -> m (Forget r a b) Source # sequence :: Monad m => Forget r a (m a0) -> m (Forget r a a0) Source #
(Traversable f, Traversable g) => Traversable (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) Source # sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) Source # mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) Source # sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) Source #
(Traversable f, Traversable g) => Traversable (f :.: g) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) Source # sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) Source # mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) Source # sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) Source #
Traversable f => Traversable (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) Source # sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) Source # mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) Source # sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) Source #
Traversable (Clown f a :: Type -> Type) |
Instance details Defined in Data.Bifunctor.Clown Methods traverse :: Applicative f0 => (a0 -> f0 b) -> Clown f a a0 -> f0 (Clown f a b) Source # sequenceA :: Applicative f0 => Clown f a (f0 a0) -> f0 (Clown f a a0) Source # mapM :: Monad m => (a0 -> m b) -> Clown f a a0 -> m (Clown f a b) Source # sequence :: Monad m => Clown f a (m a0) -> m (Clown f a a0) Source #
Bitraversable p => Traversable (Flip p a) |
Instance details Defined in Data.Bifunctor.Flip Methods traverse :: Applicative f => (a0 -> f b) -> Flip p a a0 -> f (Flip p a b) Source # sequenceA :: Applicative f => Flip p a (f a0) -> f (Flip p a a0) Source # mapM :: Monad m => (a0 -> m b) -> Flip p a a0 -> m (Flip p a b) Source # sequence :: Monad m => Flip p a (m a0) -> m (Flip p a a0) Source #
Traversable g => Traversable (Joker g a) |
Instance details Defined in Data.Bifunctor.Joker Methods traverse :: Applicative f => (a0 -> f b) -> Joker g a a0 -> f (Joker g a b) Source # sequenceA :: Applicative f => Joker g a (f a0) -> f (Joker g a a0) Source # mapM :: Monad m => (a0 -> m b) -> Joker g a a0 -> m (Joker g a b) Source # sequence :: Monad m => Joker g a (m a0) -> m (Joker g a a0) Source #
Bitraversable p => Traversable (WrappedBifunctor p a) |

Instance details

Defined in Data.Bifunctor.Wrapped

Methods

traverse :: Applicative f => (a0 -> f b) -> WrappedBifunctor p a a0 -> f (WrappedBifunctor p a b) Source #

sequenceA :: Applicative f => WrappedBifunctor p a (f a0) -> f (WrappedBifunctor p a a0) Source #

mapM :: Monad m => (a0 -> m b) -> WrappedBifunctor p a a0 -> m (WrappedBifunctor p a b) Source #

sequence :: Monad m => WrappedBifunctor p a (m a0) -> m (WrappedBifunctor p a a0) Source #

(Traversable (f a), Traversable (g a)) => Traversable (Product f g a) |

Instance details

Defined in Data.Bifunctor.Product

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> Product f g a a0 -> f0 (Product f g a b) Source #

sequenceA :: Applicative f0 => Product f g a (f0 a0) -> f0 (Product f g a a0) Source #

mapM :: Monad m => (a0 -> m b) -> Product f g a a0 -> m (Product f g a b) Source #

sequence :: Monad m => Product f g a (m a0) -> m (Product f g a a0) Source #

(Traversable (f a), Traversable (g a)) => Traversable (Sum f g a) |
Instance details Defined in Data.Bifunctor.Sum Methods traverse :: Applicative f0 => (a0 -> f0 b) -> Sum f g a a0 -> f0 (Sum f g a b) Source # sequenceA :: Applicative f0 => Sum f g a (f0 a0) -> f0 (Sum f g a a0) Source # mapM :: Monad m => (a0 -> m b) -> Sum f g a a0 -> m (Sum f g a b) Source # sequence :: Monad m => Sum f g a (m a0) -> m (Sum f g a a0) Source #
(Traversable f, Bitraversable p) => Traversable (Tannen f p a) |
Instance details Defined in Data.Bifunctor.Tannen Methods traverse :: Applicative f0 => (a0 -> f0 b) -> Tannen f p a a0 -> f0 (Tannen f p a b) Source # sequenceA :: Applicative f0 => Tannen f p a (f0 a0) -> f0 (Tannen f p a a0) Source # mapM :: Monad m => (a0 -> m b) -> Tannen f p a a0 -> m (Tannen f p a b) Source # sequence :: Monad m => Tannen f p a (m a0) -> m (Tannen f p a a0) Source #
(Bitraversable p, Traversable g) => Traversable (Biff p f g a) |
Instance details Defined in Data.Bifunctor.Biff Methods traverse :: Applicative f0 => (a0 -> f0 b) -> Biff p f g a a0 -> f0 (Biff p f g a b) Source # sequenceA :: Applicative f0 => Biff p f g a (f0 a0) -> f0 (Biff p f g a a0) Source # mapM :: Monad m => (a0 -> m b) -> Biff p f g a a0 -> m (Biff p f g a b) Source # sequence :: Monad m => Biff p f g a (m a0) -> m (Biff p f g a a0) Source #

data (a :: k) :~: (b :: k) where infix 4 Source #

Propositional equality. If `a :~: b` is inhabited by some terminating value, then the type `a` is the same as the type `b`. To use this equality in practice, pattern-match on the `a :~: b` to get out the `Refl` constructor; in the body of the pattern-match, the compiler knows that `a ~ b`.

Since: base-4.7.0.0

Constructors

Refl :: forall {k} (a :: k). a :~: a |

#### Instances

Instances details

Category ((:~:) :: k -> k -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Category Methods id :: forall (a :: k0). a :~: a Source # (.) :: forall (b :: k0) (c :: k0) (a :: k0). (b :~: c) -> (a :~: b) -> a :~: c Source #
TestEquality ((:~:) a :: k -> Type) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods testEquality :: forall (a0 :: k0) (b :: k0). (a :~: a0) -> (a :~: b) -> Maybe (a0 :~: b) Source #
NFData2 ((:~:) :: Type -> Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf2 :: (a -> ()) -> (b -> ()) -> (a :~: b) -> () Source #
NFData1 ((:~:) a) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a0 -> ()) -> (a :~: a0) -> () Source #
(a ~ b, Data a) => Data (a :~: b) | Since: base-4.7.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :~: b) -> c (a :~: b) Source #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :~: b) Source #

toConstr :: (a :~: b) -> Constr Source #

dataTypeOf :: (a :~: b) -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :~: b)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :~: b)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :~: b) -> a :~: b Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> (a :~: b) -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :~: b) -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) Source #

a ~ b => Bounded (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~: b Source # maxBound :: a :~: b Source #
a ~ b => Enum (a :~: b) | Since: base-4.7.0.0

Instance details

Defined in Data.Type.Equality

Methods

succ :: (a :~: b) -> a :~: b Source #

pred :: (a :~: b) -> a :~: b Source #

toEnum :: Int -> a :~: b Source #

fromEnum :: (a :~: b) -> Int Source #

enumFrom :: (a :~: b) -> [a :~: b] Source #

enumFromThen :: (a :~: b) -> (a :~: b) -> [a :~: b] Source #

enumFromTo :: (a :~: b) -> (a :~: b) -> [a :~: b] Source #

enumFromThenTo :: (a :~: b) -> (a :~: b) -> (a :~: b) -> [a :~: b] Source #

a ~ b => Read (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~: b) Source # readList :: ReadS [a :~: b] Source # readPrec :: ReadPrec (a :~: b) Source # readListPrec :: ReadPrec [a :~: b] Source #
Show (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~: b) -> ShowS Source # show :: (a :~: b) -> String Source # showList :: [a :~: b] -> ShowS Source #
NFData (a :~: b) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods rnf :: (a :~: b) -> () Source #
Eq (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~: b) -> (a :~: b) -> Bool Source # (/=) :: (a :~: b) -> (a :~: b) -> Bool Source #
Ord (a :~: b) | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods compare :: (a :~: b) -> (a :~: b) -> Ordering Source # (<) :: (a :~: b) -> (a :~: b) -> Bool Source # (<=) :: (a :~: b) -> (a :~: b) -> Bool Source # (>) :: (a :~: b) -> (a :~: b) -> Bool Source # (>=) :: (a :~: b) -> (a :~: b) -> Bool Source # max :: (a :~: b) -> (a :~: b) -> a :~: b Source # min :: (a :~: b) -> (a :~: b) -> a :~: b Source #

newtype Identity a Source #

Identity functor and monad. (a non-strict monad)

Since: base-4.8.0.0

Constructors

Identity |

Fields

- runIdentity :: a

#### Instances

Instances details

Representable Identity |
Instance details Defined in Data.Functor.Rep Associated Types type Rep Identity Source # Methods tabulate :: (Rep Identity -> a) -> Identity a Source # index :: Identity a -> Rep Identity -> a Source #
MonadFix Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods mfix :: (a -> Identity a) -> Identity a Source #
Foldable Identity | Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m Source #

foldMap :: Monoid m => (a -> m) -> Identity a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Identity a -> m Source #

foldr :: (a -> b -> b) -> b -> Identity a -> b Source #

foldr' :: (a -> b -> b) -> b -> Identity a -> b Source #

foldl :: (b -> a -> b) -> b -> Identity a -> b Source #

foldl' :: (b -> a -> b) -> b -> Identity a -> b Source #

foldr1 :: (a -> a -> a) -> Identity a -> a Source #

foldl1 :: (a -> a -> a) -> Identity a -> a Source #

toList :: Identity a -> [a] Source #

null :: Identity a -> Bool Source #

length :: Identity a -> Int Source #

elem :: Eq a => a -> Identity a -> Bool Source #

maximum :: Ord a => Identity a -> a Source #

minimum :: Ord a => Identity a -> a Source #

sum :: Num a => Identity a -> a Source #

product :: Num a => Identity a -> a Source #

Eq1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool Source #
Ord1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering Source #
Read1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Identity a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Identity a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Identity a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Identity a] Source #
Show1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS Source #
Traversable Identity | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) Source # sequenceA :: Applicative f => Identity (f a) -> f (Identity a) Source # mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) Source # sequence :: Monad m => Identity (m a) -> m (Identity a) Source #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a Source # (<*>) :: Identity (a -> b) -> Identity a -> Identity b Source # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source # (*>) :: Identity a -> Identity b -> Identity b Source # (<*) :: Identity a -> Identity b -> Identity a Source #
Functor Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b Source # (<$) :: a -> Identity b -> Identity a Source #
Monad Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b Source # (>>) :: Identity a -> Identity b -> Identity b Source # return :: a -> Identity a Source #
Comonad Identity |
Instance details Defined in Control.Comonad Methods extract :: Identity a -> a duplicate :: Identity a -> Identity (Identity a) extend :: (Identity a -> b) -> Identity a -> Identity b
ComonadApply Identity |
Instance details Defined in Control.Comonad Methods (<@>) :: Identity (a -> b) -> Identity a -> Identity b (@>) :: Identity a -> Identity b -> Identity b (<@) :: Identity a -> Identity b -> Identity a
NFData1 Identity | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> Identity a -> () Source #
Distributive Identity |
Instance details Defined in Data.Distributive Methods distribute :: Functor f => f (Identity a) -> Identity (f a) Source # collect :: Functor f => (a -> Identity b) -> f a -> Identity (f b) Source # distributeM :: Monad m => m (Identity a) -> Identity (m a) Source # collectM :: Monad m => (a -> Identity b) -> m a -> Identity (m b) Source #
Hashable1 Identity |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> Identity a -> Int Source #
Settable Identity | So you can pass our `Setter` into combinators from other lens libraries.
Instance details Defined in Control.Lens.Internal.Setter Methods untainted :: Identity a -> a Source # untaintedDot :: Profunctor p => p a (Identity b) -> p a b Source # taintedDot :: Profunctor p => p a b -> p a (Identity b) Source #
Affine Identity |
Instance details Defined in Linear.Affine Associated Types type Diff Identity :: Type -> Type Source # Methods (.-.) :: Num a => Identity a -> Identity a -> Diff Identity a Source # (.+^) :: Num a => Identity a -> Diff Identity a -> Identity a Source # (.-^) :: Num a => Identity a -> Diff Identity a -> Identity a Source #
Metric Identity |
Instance details Defined in Linear.Metric Methods dot :: Num a => Identity a -> Identity a -> a Source # quadrance :: Num a => Identity a -> a Source # qd :: Num a => Identity a -> Identity a -> a Source # distance :: Floating a => Identity a -> Identity a -> a Source # norm :: Floating a => Identity a -> a Source # signorm :: Floating a => Identity a -> Identity a Source #
R1 Identity |
Instance details Defined in Linear.V1 Methods _x :: Lens' (Identity a) a Source #
Additive Identity |

Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Identity a Source #

(^+^) :: Num a => Identity a -> Identity a -> Identity a Source #

(^-^) :: Num a => Identity a -> Identity a -> Identity a Source #

lerp :: Num a => a -> Identity a -> Identity a -> Identity a Source #

liftU2 :: (a -> a -> a) -> Identity a -> Identity a -> Identity a Source #

liftI2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source #

Apply Identity |
Instance details Defined in Data.Functor.Bind.Class Methods (<.>) :: Identity (a -> b) -> Identity a -> Identity b (.>) :: Identity a -> Identity b -> Identity b (<.) :: Identity a -> Identity b -> Identity a liftF2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c
Bind Identity |
Instance details Defined in Data.Functor.Bind.Class Methods (>>-) :: Identity a -> (a -> Identity b) -> Identity b join :: Identity (Identity a) -> Identity a
Traversable1 Identity |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Identity a -> f (Identity b) # sequence1 :: Apply f => Identity (f b) -> f (Identity b)
Generic1 Identity |
Instance details Defined in Data.Functor.Identity Associated Types type Rep1 Identity :: k -> Type Source # Methods from1 :: forall (a :: k). Identity a -> Rep1 Identity a Source # to1 :: forall (a :: k). Rep1 Identity a -> Identity a Source #
FoldableWithIndex () Identity |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (() -> a -> m) -> Identity a -> m # ifoldMap' :: Monoid m => (() -> a -> m) -> Identity a -> m # ifoldr :: (() -> a -> b -> b) -> b -> Identity a -> b # ifoldl :: (() -> b -> a -> b) -> b -> Identity a -> b # ifoldr' :: (() -> a -> b -> b) -> b -> Identity a -> b # ifoldl' :: (() -> b -> a -> b) -> b -> Identity a -> b #
FunctorWithIndex () Identity |
Instance details Defined in WithIndex Methods imap :: (() -> a -> b) -> Identity a -> Identity b #
TraversableWithIndex () Identity |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (() -> a -> f b) -> Identity a -> f (Identity b) #
Cosieve ReifiedGetter Identity |
Instance details Defined in Control.Lens.Reified Methods cosieve :: ReifiedGetter a b -> Identity a -> b Source #
Sieve ReifiedGetter Identity |
Instance details Defined in Control.Lens.Reified Methods sieve :: ReifiedGetter a b -> a -> Identity b Source #
Unbox a => Vector Vector (Identity a) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: Mutable Vector s (Identity a) -> ST s (Vector (Identity a))

basicUnsafeThaw :: Vector (Identity a) -> ST s (Mutable Vector s (Identity a))

basicLength :: Vector (Identity a) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (Identity a) -> Vector (Identity a)

basicUnsafeIndexM :: Vector (Identity a) -> Int -> Box (Identity a)

basicUnsafeCopy :: Mutable Vector s (Identity a) -> Vector (Identity a) -> ST s ()

elemseq :: Vector (Identity a) -> Identity a -> b -> b

Unbox a => MVector MVector (Identity a) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (Identity a) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (Identity a) -> MVector s (Identity a)

basicOverlaps :: MVector s (Identity a) -> MVector s (Identity a) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (Identity a))

basicInitialize :: MVector s (Identity a) -> ST s ()

basicUnsafeReplicate :: Int -> Identity a -> ST s (MVector s (Identity a))

basicUnsafeRead :: MVector s (Identity a) -> Int -> ST s (Identity a)

basicUnsafeWrite :: MVector s (Identity a) -> Int -> Identity a -> ST s ()

basicClear :: MVector s (Identity a) -> ST s ()

basicSet :: MVector s (Identity a) -> Identity a -> ST s ()

basicUnsafeCopy :: MVector s (Identity a) -> MVector s (Identity a) -> ST s ()

basicUnsafeMove :: MVector s (Identity a) -> MVector s (Identity a) -> ST s ()

basicUnsafeGrow :: MVector s (Identity a) -> Int -> ST s (MVector s (Identity a))

Data a => Data (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) Source #

toConstr :: Identity a -> Constr Source #

dataTypeOf :: Identity a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) Source #

IsString a => IsString (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Identity a Source #
Storable a => Storable (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

sizeOf :: Identity a -> Int Source #

alignment :: Identity a -> Int Source #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) Source #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Identity a) Source #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () Source #

peek :: Ptr (Identity a) -> IO (Identity a) Source #

poke :: Ptr (Identity a) -> Identity a -> IO () Source #

Monoid a => Monoid (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods mempty :: Identity a Source # mappend :: Identity a -> Identity a -> Identity a Source # mconcat :: [Identity a] -> Identity a Source #
Semigroup a => Semigroup (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods (<>) :: Identity a -> Identity a -> Identity a Source # sconcat :: NonEmpty (Identity a) -> Identity a Source # stimes :: Integral b => b -> Identity a -> Identity a Source #
Bits a => Bits (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(.&.) :: Identity a -> Identity a -> Identity a Source #

(.|.) :: Identity a -> Identity a -> Identity a Source #

xor :: Identity a -> Identity a -> Identity a Source #

complement :: Identity a -> Identity a Source #

shift :: Identity a -> Int -> Identity a Source #

rotate :: Identity a -> Int -> Identity a Source #

zeroBits :: Identity a Source #

bit :: Int -> Identity a Source #

setBit :: Identity a -> Int -> Identity a Source #

clearBit :: Identity a -> Int -> Identity a Source #

complementBit :: Identity a -> Int -> Identity a Source #

testBit :: Identity a -> Int -> Bool Source #

bitSizeMaybe :: Identity a -> Maybe Int Source #

bitSize :: Identity a -> Int Source #

isSigned :: Identity a -> Bool Source #

shiftL :: Identity a -> Int -> Identity a Source #

unsafeShiftL :: Identity a -> Int -> Identity a Source #

shiftR :: Identity a -> Int -> Identity a Source #

unsafeShiftR :: Identity a -> Int -> Identity a Source #

rotateL :: Identity a -> Int -> Identity a Source #

rotateR :: Identity a -> Int -> Identity a Source #

popCount :: Identity a -> Int Source #

FiniteBits a => FiniteBits (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods finiteBitSize :: Identity a -> Int Source # countLeadingZeros :: Identity a -> Int Source # countTrailingZeros :: Identity a -> Int Source #
Bounded a => Bounded (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods minBound :: Identity a Source # maxBound :: Identity a Source #
Enum a => Enum (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

succ :: Identity a -> Identity a Source #

pred :: Identity a -> Identity a Source #

toEnum :: Int -> Identity a Source #

fromEnum :: Identity a -> Int Source #

enumFrom :: Identity a -> [Identity a] Source #

enumFromThen :: Identity a -> Identity a -> [Identity a] Source #

enumFromTo :: Identity a -> Identity a -> [Identity a] Source #

enumFromThenTo :: Identity a -> Identity a -> Identity a -> [Identity a] Source #

Floating a => Floating (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pi :: Identity a Source #

exp :: Identity a -> Identity a Source #

log :: Identity a -> Identity a Source #

sqrt :: Identity a -> Identity a Source #

(**) :: Identity a -> Identity a -> Identity a Source #

logBase :: Identity a -> Identity a -> Identity a Source #

sin :: Identity a -> Identity a Source #

cos :: Identity a -> Identity a Source #

tan :: Identity a -> Identity a Source #

asin :: Identity a -> Identity a Source #

acos :: Identity a -> Identity a Source #

atan :: Identity a -> Identity a Source #

sinh :: Identity a -> Identity a Source #

cosh :: Identity a -> Identity a Source #

tanh :: Identity a -> Identity a Source #

asinh :: Identity a -> Identity a Source #

acosh :: Identity a -> Identity a Source #

atanh :: Identity a -> Identity a Source #

log1p :: Identity a -> Identity a Source #

expm1 :: Identity a -> Identity a Source #

log1pexp :: Identity a -> Identity a Source #

log1mexp :: Identity a -> Identity a Source #

RealFloat a => RealFloat (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

floatRadix :: Identity a -> Integer Source #

floatDigits :: Identity a -> Int Source #

floatRange :: Identity a -> (Int, Int) Source #

decodeFloat :: Identity a -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Identity a Source #

exponent :: Identity a -> Int Source #

significand :: Identity a -> Identity a Source #

scaleFloat :: Int -> Identity a -> Identity a Source #

isNaN :: Identity a -> Bool Source #

isInfinite :: Identity a -> Bool Source #

isDenormalized :: Identity a -> Bool Source #

isNegativeZero :: Identity a -> Bool Source #

isIEEE :: Identity a -> Bool Source #

atan2 :: Identity a -> Identity a -> Identity a Source #

Generic (Identity a) |
Instance details Defined in Data.Functor.Identity Associated Types type Rep (Identity a) :: Type -> Type Source # Methods from :: Identity a -> Rep (Identity a) x Source # to :: Rep (Identity a) x -> Identity a Source #
Ix a => Ix (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

range :: (Identity a, Identity a) -> [Identity a] Source #

index :: (Identity a, Identity a) -> Identity a -> Int Source #

unsafeIndex :: (Identity a, Identity a) -> Identity a -> Int Source #

inRange :: (Identity a, Identity a) -> Identity a -> Bool Source #

rangeSize :: (Identity a, Identity a) -> Int Source #

unsafeRangeSize :: (Identity a, Identity a) -> Int Source #

Num a => Num (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods (+) :: Identity a -> Identity a -> Identity a Source # (-) :: Identity a -> Identity a -> Identity a Source # (*) :: Identity a -> Identity a -> Identity a Source # negate :: Identity a -> Identity a Source # abs :: Identity a -> Identity a Source # signum :: Identity a -> Identity a Source # fromInteger :: Integer -> Identity a Source #
Read a => Read (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods readsPrec :: Int -> ReadS (Identity a) Source # readList :: ReadS [Identity a] Source # readPrec :: ReadPrec (Identity a) Source # readListPrec :: ReadPrec [Identity a] Source #
Fractional a => Fractional (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods (/) :: Identity a -> Identity a -> Identity a Source # recip :: Identity a -> Identity a Source # fromRational :: Rational -> Identity a Source #
Integral a => Integral (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

quot :: Identity a -> Identity a -> Identity a Source #

rem :: Identity a -> Identity a -> Identity a Source #

div :: Identity a -> Identity a -> Identity a Source #

mod :: Identity a -> Identity a -> Identity a Source #

quotRem :: Identity a -> Identity a -> (Identity a, Identity a) Source #

divMod :: Identity a -> Identity a -> (Identity a, Identity a) Source #

toInteger :: Identity a -> Integer Source #

Real a => Real (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods toRational :: Identity a -> Rational Source #
RealFrac a => RealFrac (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods properFraction :: Integral b => Identity a -> (b, Identity a) Source # truncate :: Integral b => Identity a -> b Source # round :: Integral b => Identity a -> b Source # ceiling :: Integral b => Identity a -> b Source # floor :: Integral b => Identity a -> b Source #
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods showsPrec :: Int -> Identity a -> ShowS Source # show :: Identity a -> String Source # showList :: [Identity a] -> ShowS Source #
NFData a => NFData (Identity a) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: Identity a -> () Source #
Eq a => Eq (Identity a) | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (==) :: Identity a -> Identity a -> Bool Source # (/=) :: Identity a -> Identity a -> Bool Source #
Ord a => Ord (Identity a) | Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

compare :: Identity a -> Identity a -> Ordering Source #

(<) :: Identity a -> Identity a -> Bool Source #

(<=) :: Identity a -> Identity a -> Bool Source #

(>) :: Identity a -> Identity a -> Bool Source #

(>=) :: Identity a -> Identity a -> Bool Source #

max :: Identity a -> Identity a -> Identity a Source #

min :: Identity a -> Identity a -> Identity a Source #

Hashable a => Hashable (Identity a) |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Identity a -> Int Source # hash :: Identity a -> Int Source #
Ixed (Identity a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) Source #
Wrapped (Identity a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Identity a) Source # Methods _Wrapped' :: Iso' (Identity a) (Unwrapped (Identity a)) Source #
Unbox a => Unbox (Identity a) |
Instance details Defined in Data.Vector.Unboxed.Base
t ~ Identity b => Rewrapped (Identity a) t |
Instance details Defined in Control.Lens.Wrapped

Each (Identity a) (Identity b) a b

    each :: Traversal (Identity a) (Identity b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Identity a) (Identity b) a b Source #
Field1 (Identity a) (Identity b) a b |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (Identity a) (Identity b) a b Source #
Cosieve (->) Identity |
Instance details Defined in Data.Profunctor.Sieve Methods cosieve :: (a -> b) -> Identity a -> b Source #
Sieve (->) Identity |
Instance details Defined in Data.Profunctor.Sieve Methods sieve :: (a -> b) -> a -> Identity b Source #
type Rep Identity |
Instance details Defined in Data.Functor.Rep type Rep Identity = ()
type Diff Identity |
Instance details Defined in Linear.Affine type Diff Identity = Identity
type Rep1 Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity type Rep1 Identity = D1 ('MetaData "Identity" "Data.Functor.Identity" "base" 'True) (C1 ('MetaCons "Identity" 'PrefixI 'True) (S1 ('MetaSel ('Just "runIdentity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
newtype MVector s (Identity a) |
Instance details Defined in Data.Vector.Unboxed.Base newtype MVector s (Identity a) = MV_Identity (MVector s a)
type Rep (Identity a) | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity type Rep (Identity a) = D1 ('MetaData "Identity" "Data.Functor.Identity" "base" 'True) (C1 ('MetaCons "Identity" 'PrefixI 'True) (S1 ('MetaSel ('Just "runIdentity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Index (Identity a) |
Instance details Defined in Control.Lens.At type Index (Identity a) = ()
type IxValue (Identity a) |
Instance details Defined in Control.Lens.At type IxValue (Identity a) = a
type Unwrapped (Identity a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Identity a) = a
newtype Vector (Identity a) |
Instance details Defined in Data.Vector.Unboxed.Base newtype Vector (Identity a) = V_Identity (Vector a)

newtype Const a (b :: k) Source #

The `Const` functor.

Constructors

Const |

Fields

- getConst :: a

#### Instances

Instances details

Generic1 (Const a :: k -> Type) |
Instance details Defined in Data.Functor.Const Associated Types type Rep1 (Const a) :: k -> Type Source # Methods from1 :: forall (a0 :: k0). Const a a0 -> Rep1 (Const a) a0 Source # to1 :: forall (a0 :: k0). Rep1 (Const a) a0 -> Const a a0 Source #
FoldableWithIndex Void (Const e :: Type -> Type) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Void -> a -> m) -> Const e a -> m # ifoldMap' :: Monoid m => (Void -> a -> m) -> Const e a -> m # ifoldr :: (Void -> a -> b -> b) -> b -> Const e a -> b # ifoldl :: (Void -> b -> a -> b) -> b -> Const e a -> b # ifoldr' :: (Void -> a -> b -> b) -> b -> Const e a -> b # ifoldl' :: (Void -> b -> a -> b) -> b -> Const e a -> b #
FunctorWithIndex Void (Const e :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> Const e a -> Const e b #
TraversableWithIndex Void (Const e :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> Const e a -> f (Const e b) #
Unbox a => Vector Vector (Const a b) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: Mutable Vector s (Const a b) -> ST s (Vector (Const a b))

basicUnsafeThaw :: Vector (Const a b) -> ST s (Mutable Vector s (Const a b))

basicLength :: Vector (Const a b) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (Const a b) -> Vector (Const a b)

basicUnsafeIndexM :: Vector (Const a b) -> Int -> Box (Const a b)

basicUnsafeCopy :: Mutable Vector s (Const a b) -> Vector (Const a b) -> ST s ()

elemseq :: Vector (Const a b) -> Const a b -> b0 -> b0

Unbox a => MVector MVector (Const a b) |

Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (Const a b) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (Const a b) -> MVector s (Const a b)

basicOverlaps :: MVector s (Const a b) -> MVector s (Const a b) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (Const a b))

basicInitialize :: MVector s (Const a b) -> ST s ()

basicUnsafeReplicate :: Int -> Const a b -> ST s (MVector s (Const a b))

basicUnsafeRead :: MVector s (Const a b) -> Int -> ST s (Const a b)

basicUnsafeWrite :: MVector s (Const a b) -> Int -> Const a b -> ST s ()

basicClear :: MVector s (Const a b) -> ST s ()

basicSet :: MVector s (Const a b) -> Const a b -> ST s ()

basicUnsafeCopy :: MVector s (Const a b) -> MVector s (Const a b) -> ST s ()

basicUnsafeMove :: MVector s (Const a b) -> MVector s (Const a b) -> ST s ()

basicUnsafeGrow :: MVector s (Const a b) -> Int -> ST s (MVector s (Const a b))

Bifoldable (Const :: Type -> Type -> Type) | Since: base-4.10.0.0
Instance details Defined in Data.Bifoldable Methods bifold :: Monoid m => Const m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Const a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Const a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Const a b -> c Source #
Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d Source # first :: (a -> b) -> Const a c -> Const b c Source # second :: (b -> c) -> Const a b -> Const a c Source #
Bitraversable (Const :: Type -> Type -> Type) | Since: base-4.10.0.0
Instance details Defined in Data.Bitraversable Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Const a b -> f (Const c d) Source #
Eq2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const a c -> Const b d -> Bool Source #
Ord2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const a c -> Const b d -> Ordering Source #
Read2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const a b) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] Source #

Show2 (Const :: Type -> Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const a b -> ShowS Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const a b] -> ShowS Source #
NFData2 (Const :: Type -> Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf2 :: (a -> ()) -> (b -> ()) -> Const a b -> () Source #
Hashable2 (Const :: Type -> Type -> Type) |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt2 :: (Int -> a -> Int) -> (Int -> b -> Int) -> Int -> Const a b -> Int Source #
Biapply (Const :: Type -> Type -> Type) |
Instance details Defined in Data.Functor.Bind.Class Methods (<<.>>) :: Const (a -> b) (c -> d) -> Const a c -> Const b d (.>>) :: Const a b -> Const c d -> Const c d (<<.) :: Const a b -> Const c d -> Const a b
Bitraversable1 (Const :: Type -> Type -> Type) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods bitraverse1 :: Apply f => (a -> f b) -> (c -> f d) -> Const a c -> f (Const b d) bisequence1 :: Apply f => Const (f a) (f b) -> f (Const a b)
Foldable (Const m :: Type -> Type) | Since: base-4.7.0.0

Instance details

Defined in Data.Functor.Const

Methods

fold :: Monoid m0 => Const m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> Const m a -> b Source #

foldr' :: (a -> b -> b) -> b -> Const m a -> b Source #

foldl :: (b -> a -> b) -> b -> Const m a -> b Source #

foldl' :: (b -> a -> b) -> b -> Const m a -> b Source #

foldr1 :: (a -> a -> a) -> Const m a -> a Source #

foldl1 :: (a -> a -> a) -> Const m a -> a Source #

toList :: Const m a -> [a] Source #

null :: Const m a -> Bool Source #

length :: Const m a -> Int Source #

elem :: Eq a => a -> Const m a -> Bool Source #

maximum :: Ord a => Const m a -> a Source #

minimum :: Ord a => Const m a -> a Source #

sum :: Num a => Const m a -> a Source #

product :: Num a => Const m a -> a Source #

Eq a => Eq1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Const a a0 -> Const a b -> Bool Source #
Ord a => Ord1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Const a a0 -> Const a b -> Ordering Source #
Read a => Read1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] Source #
Show a => Show1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Const a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS Source #
Contravariant (Const a :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a0) -> Const a a0 -> Const a a' Source # (>$) :: b -> Const a b -> Const a a0 Source #
Traversable (Const m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) Source # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) Source # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) Source # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) Source #
Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a Source # (<*>) :: Const m (a -> b) -> Const m a -> Const m b Source # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source # (*>) :: Const m a -> Const m b -> Const m b Source # (<*) :: Const m a -> Const m b -> Const m a Source #
Functor (Const m :: Type -> Type) | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b Source # (<$) :: a -> Const m b -> Const m a Source #
NFData a => NFData1 (Const a :: Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a0 -> ()) -> Const a a0 -> () Source #
Hashable a => Hashable1 (Const a :: Type -> Type) |
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt :: (Int -> a0 -> Int) -> Int -> Const a a0 -> Int Source #
Semigroup m => Apply (Const m :: Type -> Type) |
Instance details Defined in Data.Functor.Bind.Class Methods (<.>) :: Const m (a -> b) -> Const m a -> Const m b (.>) :: Const m a -> Const m b -> Const m b (<.) :: Const m a -> Const m b -> Const m a liftF2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c
Sieve (Forget r :: Type -> Type -> Type) (Const r :: Type -> Type) |
Instance details Defined in Data.Profunctor.Sieve Methods sieve :: Forget r a b -> a -> Const r b Source #
(Typeable k, Data a, Typeable b) => Data (Const a b) | Since: base-4.10.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Const a b -> c (Const a b) Source #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Const a b) Source #

toConstr :: Const a b -> Constr Source #

dataTypeOf :: Const a b -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Const a b)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Const a b)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Const a b -> Const a b Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Const a b -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Const a b -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Const a b -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Const a b -> m (Const a b) Source #

IsString a => IsString (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Const a b Source #
Storable a => Storable (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

sizeOf :: Const a b -> Int Source #

alignment :: Const a b -> Int Source #

peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) Source #

pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () Source #

peekByteOff :: Ptr b0 -> Int -> IO (Const a b) Source #

pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () Source #

peek :: Ptr (Const a b) -> IO (Const a b) Source #

poke :: Ptr (Const a b) -> Const a b -> IO () Source #

Monoid a => Monoid (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b Source # mappend :: Const a b -> Const a b -> Const a b Source # mconcat :: [Const a b] -> Const a b Source #
Semigroup a => Semigroup (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b Source # sconcat :: NonEmpty (Const a b) -> Const a b Source # stimes :: Integral b0 => b0 -> Const a b -> Const a b Source #
Bits a => Bits (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(.&.) :: Const a b -> Const a b -> Const a b Source #

(.|.) :: Const a b -> Const a b -> Const a b Source #

xor :: Const a b -> Const a b -> Const a b Source #

complement :: Const a b -> Const a b Source #

shift :: Const a b -> Int -> Const a b Source #

rotate :: Const a b -> Int -> Const a b Source #

zeroBits :: Const a b Source #

bit :: Int -> Const a b Source #

setBit :: Const a b -> Int -> Const a b Source #

clearBit :: Const a b -> Int -> Const a b Source #

complementBit :: Const a b -> Int -> Const a b Source #

testBit :: Const a b -> Int -> Bool Source #

bitSizeMaybe :: Const a b -> Maybe Int Source #

bitSize :: Const a b -> Int Source #

isSigned :: Const a b -> Bool Source #

shiftL :: Const a b -> Int -> Const a b Source #

unsafeShiftL :: Const a b -> Int -> Const a b Source #

shiftR :: Const a b -> Int -> Const a b Source #

unsafeShiftR :: Const a b -> Int -> Const a b Source #

rotateL :: Const a b -> Int -> Const a b Source #

rotateR :: Const a b -> Int -> Const a b Source #

popCount :: Const a b -> Int Source #

FiniteBits a => FiniteBits (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int Source # countLeadingZeros :: Const a b -> Int Source # countTrailingZeros :: Const a b -> Int Source #
Bounded a => Bounded (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods minBound :: Const a b Source # maxBound :: Const a b Source #
Enum a => Enum (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

succ :: Const a b -> Const a b Source #

pred :: Const a b -> Const a b Source #

toEnum :: Int -> Const a b Source #

fromEnum :: Const a b -> Int Source #

enumFrom :: Const a b -> [Const a b] Source #

enumFromThen :: Const a b -> Const a b -> [Const a b] Source #

enumFromTo :: Const a b -> Const a b -> [Const a b] Source #

enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] Source #

Floating a => Floating (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

pi :: Const a b Source #

exp :: Const a b -> Const a b Source #

log :: Const a b -> Const a b Source #

sqrt :: Const a b -> Const a b Source #

(**) :: Const a b -> Const a b -> Const a b Source #

logBase :: Const a b -> Const a b -> Const a b Source #

sin :: Const a b -> Const a b Source #

cos :: Const a b -> Const a b Source #

tan :: Const a b -> Const a b Source #

asin :: Const a b -> Const a b Source #

acos :: Const a b -> Const a b Source #

atan :: Const a b -> Const a b Source #

sinh :: Const a b -> Const a b Source #

cosh :: Const a b -> Const a b Source #

tanh :: Const a b -> Const a b Source #

asinh :: Const a b -> Const a b Source #

acosh :: Const a b -> Const a b Source #

atanh :: Const a b -> Const a b Source #

log1p :: Const a b -> Const a b Source #

expm1 :: Const a b -> Const a b Source #

log1pexp :: Const a b -> Const a b Source #

log1mexp :: Const a b -> Const a b Source #

RealFloat a => RealFloat (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

floatRadix :: Const a b -> Integer Source #

floatDigits :: Const a b -> Int Source #

floatRange :: Const a b -> (Int, Int) Source #

decodeFloat :: Const a b -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Const a b Source #

exponent :: Const a b -> Int Source #

significand :: Const a b -> Const a b Source #

scaleFloat :: Int -> Const a b -> Const a b Source #

isNaN :: Const a b -> Bool Source #

isInfinite :: Const a b -> Bool Source #

isDenormalized :: Const a b -> Bool Source #

isNegativeZero :: Const a b -> Bool Source #

isIEEE :: Const a b -> Bool Source #

atan2 :: Const a b -> Const a b -> Const a b Source #

Generic (Const a b) |
Instance details Defined in Data.Functor.Const Associated Types type Rep (Const a b) :: Type -> Type Source # Methods from :: Const a b -> Rep (Const a b) x Source # to :: Rep (Const a b) x -> Const a b Source #
Ix a => Ix (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

range :: (Const a b, Const a b) -> [Const a b] Source #

index :: (Const a b, Const a b) -> Const a b -> Int Source #

unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int Source #

inRange :: (Const a b, Const a b) -> Const a b -> Bool Source #

rangeSize :: (Const a b, Const a b) -> Int Source #

unsafeRangeSize :: (Const a b, Const a b) -> Int Source #

Num a => Num (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b Source # (-) :: Const a b -> Const a b -> Const a b Source # (*) :: Const a b -> Const a b -> Const a b Source # negate :: Const a b -> Const a b Source # abs :: Const a b -> Const a b Source # signum :: Const a b -> Const a b Source # fromInteger :: Integer -> Const a b Source #
Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `getConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) Source # readList :: ReadS [Const a b] Source # readPrec :: ReadPrec (Const a b) Source # readListPrec :: ReadPrec [Const a b] Source #
Fractional a => Fractional (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b Source # recip :: Const a b -> Const a b Source # fromRational :: Rational -> Const a b Source #
Integral a => Integral (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

quot :: Const a b -> Const a b -> Const a b Source #

rem :: Const a b -> Const a b -> Const a b Source #

div :: Const a b -> Const a b -> Const a b Source #

mod :: Const a b -> Const a b -> Const a b Source #

quotRem :: Const a b -> Const a b -> (Const a b, Const a b) Source #

divMod :: Const a b -> Const a b -> (Const a b, Const a b) Source #

toInteger :: Const a b -> Integer Source #

Real a => Real (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational Source #
RealFrac a => RealFrac (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) Source # truncate :: Integral b0 => Const a b -> b0 Source # round :: Integral b0 => Const a b -> b0 Source # ceiling :: Integral b0 => Const a b -> b0 Source # floor :: Integral b0 => Const a b -> b0 Source #
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `getConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS Source # show :: Const a b -> String Source # showList :: [Const a b] -> ShowS Source #
NFData a => NFData (Const a b) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: Const a b -> () Source #
Eq a => Eq (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool Source # (/=) :: Const a b -> Const a b -> Bool Source #
Ord a => Ord (Const a b) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

compare :: Const a b -> Const a b -> Ordering Source #

(<) :: Const a b -> Const a b -> Bool Source #

(<=) :: Const a b -> Const a b -> Bool Source #

(>) :: Const a b -> Const a b -> Bool Source #

(>=) :: Const a b -> Const a b -> Bool Source #

max :: Const a b -> Const a b -> Const a b Source #

min :: Const a b -> Const a b -> Const a b Source #

Hashable a => Hashable (Const a b) |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Const a b -> Int Source # hash :: Const a b -> Int Source #
Wrapped (Const a x) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Const a x) Source # Methods _Wrapped' :: Iso' (Const a x) (Unwrapped (Const a x)) Source #
Unbox a => Unbox (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base
t ~ Const a' x' => Rewrapped (Const a x) t |
Instance details Defined in Control.Lens.Wrapped
type Rep1 (Const a :: k -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const type Rep1 (Const a :: k -> Type) = D1 ('MetaData "Const" "Data.Functor.Const" "base" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
newtype MVector s (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base newtype MVector s (Const a b) = MV_Const (MVector s a)
type Rep (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Const type Rep (Const a b) = D1 ('MetaData "Const" "Data.Functor.Const" "base" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Unwrapped (Const a x) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Const a x) = a
newtype Vector (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base newtype Vector (Const a b) = V_Const (Vector a)

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

Isomorphism families can be composed with another `Lens` using (`.`) and `id`.

Since every `Iso` is both a valid `Lens` and a valid `Prism`, the laws for those types imply the following laws for an `Iso` `f`:

    f . from f ≡ id
    from f . f ≡ id

Note: Composition with an `Iso` is index- and measure- preserving.

type IndexedTraversal i s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Applicative f) => p a (f b) -> s -> f t Source #

Every `IndexedTraversal` is a valid `Traversal` or `IndexedFold`.

The `Indexed` constraint is used to allow an `IndexedTraversal` to be used directly as a `Traversal`.

The `Traversal` laws are still required to hold.

In addition, the index `i` should satisfy the requirement that it stays unchanged even when modifying the value `a`, otherwise traversals like `indices` break the `Traversal` laws.

type IndexedFold i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> s -> f s Source #

Every `IndexedFold` is a valid `Fold` and can be used for `Getting`.

type Prism s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Choice p, Applicative f) => p a (f b) -> p s (f t) Source #

A `Prism` `l` is a `Traversal` that can also be turned around with `re` to obtain a `Getter` in the opposite direction.

There are three laws that a `Prism` should satisfy:

First, if I `re` or `review` a value with a `Prism` and then `preview` or use (`^?`), I will get it back:

    preview l (review l b) ≡ Just b

Second, if you can extract a value `a` using a `Prism` `l` from a value `s`, then the value `s` is completely described by `l` and `a`:

    preview l s ≡ Just a ⟹ review l a ≡ s

Third, if you get non-match `t`, you can convert it result back to `s`:

    matching l s ≡ Left t ⟹ matching l t ≡ Left s

The first two laws imply that the `Traversal` laws hold for every `Prism` and that we `traverse` at most 1 element:

    lengthOf l x <= 1

It may help to think of this as an `Iso` that can be partial in one direction.

Every `Prism` is a valid `Traversal`.

Every `Iso` is a valid `Prism`.

For example, you might have a ``Prism'` `Integer` `Natural`` allows you to always go from a `Natural` to an `Integer`, and provide you with tools to check if an `Integer` is a `Natural` and/or to edit one if it is.

    nat :: Prism' Integer Natural
    nat = prism toInteger $ \ i ->
       if i < 0
       then Left i
       else Right (fromInteger i)

Now we can ask if an `Integer` is a `Natural`.

    >>> 5^?nat
    Just 5

    >>> (-5)^?nat
    Nothing

We can update the ones that are:

    >>> (-3,4) & both.nat *~ 2
    (-3,8)

And we can then convert from a `Natural` to an `Integer`.

    >>> 5 ^. re nat -- :: Natural
    5

Similarly we can use a `Prism` to `traverse` the `Left` half of an `Either`:

    >>> Left "hello" & _Left %~ length
    Left 5

or to construct an `Either`:

    >>> 5^.re _Left
    Left 5

such that if you query it with the `Prism`, you will get your original input back.

    >>> 5^.re _Left ^? _Left
    Just 5

Another interesting way to think of a `Prism` is as the categorical dual of a `Lens` -- a co-`Lens`, so to speak. This is what permits the construction of `outside`.

Note: Composition with a `Prism` is index-preserving.

type Lens s t a b = forall (f :: Type -> Type). Functor f => (a -> f b) -> s -> f t Source #

A `Lens` is actually a lens family as described in http://comonad.com/reader/2012/mirrored-lenses/.

With great power comes great responsibility and a `Lens` is subject to the three common sense `Lens` laws:

1) You get back what you put in:

    view l (set l v s)  ≡ v

2) Putting back what you got doesn't change anything:

    set l (view l s) s  ≡ s

3) Setting twice is the same as setting once:

    set l v' (set l v s) ≡ set l v' s

These laws are strong enough that the 4 type parameters of a `Lens` cannot vary fully independently. For more on how they interact, read the "Why is it a Lens Family?" section of http://comonad.com/reader/2012/mirrored-lenses/.

There are some emergent properties of these laws:

1) ``set` l s` must be injective for every `s` This is a consequence of law #1

2) ``set` l` must be surjective, because of law #2, which indicates that it is possible to obtain any `v` from some `s` such that ``set` s v = s`

3) Given just the first two laws you can prove a weaker form of law #3 where the values `v` that you are setting match:

    set l v (set l v s) ≡ set l v s

Every `Lens` can be used directly as a `Setter` or `Traversal`.

You can also use a `Lens` for `Getting` as if it were a `Fold` or `Getter`.

Since every `Lens` is a valid `Traversal`, the `Traversal` laws are required of any `Lens` you create:

    l pure ≡ pure
    fmap (l f) . l g ≡ getCompose . l (Compose . fmap f . g)

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

type IndexedLens i s t a b = forall (f :: Type -> Type) (p :: Type -> Type -> Type). (Indexable i p, Functor f) => p a (f b) -> s -> f t Source #

Every `IndexedLens` is a valid `Lens` and a valid `IndexedTraversal`.

type Getter s a = forall (f :: Type -> Type). (Contravariant f, Functor f) => (a -> f a) -> s -> f s Source #

A `Getter` describes how to retrieve a single value in a way that can be composed with other `LensLike` constructions.

Unlike a `Lens` a `Getter` is read-only. Since a `Getter` cannot be used to write back there are no `Lens` laws that can be applied to it. In fact, it is isomorphic to an arbitrary function from `(s -> a)`.

Moreover, a `Getter` can be used directly as a `Fold`, since it just ignores the `Applicative`.

type IndexedGetter i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Functor f) => p a (f a) -> s -> f s Source #

Every `IndexedGetter` is a valid `IndexedFold` and can be used for `Getting` like a `Getter`.

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

Many combinators that accept a `Lens` can also accept a `Traversal` in limited situations.

They do so by specializing the type of `Functor` that they require of the caller.

If a function accepts a ``LensLike` f s t a b` for some `Functor` `f`, then they may be passed a `Lens`.

Further, if `f` is an `Applicative`, they may also be passed a `Traversal`.

type Over (p :: k -> Type -> Type) (f :: k1 -> Type) s (t :: k1) (a :: k) (b :: k1) = p a (f b) -> s -> f t Source #

This is a convenient alias for use when you need to consume either indexed or non-indexed lens-likes based on context.

newtype Bazaar (p :: Type -> Type -> Type) a b t Source #

This is used to characterize a `Traversal`.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed `FunList`.

http://twanvl.nl/blog/haskell/non-regular1

A `Bazaar` is like a `Traversal` that has already been applied to some structure.

Where a ``Context` a b t` holds an `a` and a function from `b` to `t`, a ``Bazaar` a b t` holds `N` `a`s and a function from `N` `b`s to `t`, (where `N` might be infinite).

Mnemonically, a `Bazaar` holds many stores and you can easily add more.

This is a final encoding of `Bazaar`.

Constructors

Bazaar |

Fields

- runBazaar :: forall (f :: Type -> Type). Applicative f => p a (f b) -> f t

#### Instances

Instances details

Profunctor p => Bizarre p (Bazaar p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods bazaar :: Applicative f => p a (f b) -> Bazaar p a b t -> f t Source #
Corepresentable p => Sellable p (Bazaar p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods sell :: p a (Bazaar p a b b) Source #
Conjoined p => IndexedComonad (Bazaar p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods iextract :: Bazaar p a a t -> t Source # iduplicate :: Bazaar p a c t -> Bazaar p a b (Bazaar p b c t) Source # iextend :: (Bazaar p b c t -> r) -> Bazaar p a c t -> Bazaar p a b r Source #
IndexedFunctor (Bazaar p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods ifmap :: (s -> t) -> Bazaar p a b s -> Bazaar p a b t Source #
Applicative (Bazaar p a b) |

Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: a0 -> Bazaar p a b a0 Source #

(<*>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c Source #

(*>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 Source #

(<*) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 Source #

Functor (Bazaar p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods fmap :: (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 Source # (<$) :: a0 -> Bazaar p a b b0 -> Bazaar p a b a0 Source #
(a ~ b, Conjoined p) => Comonad (Bazaar p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods extract :: Bazaar p a b a0 -> a0 duplicate :: Bazaar p a b a0 -> Bazaar p a b (Bazaar p a b a0) extend :: (Bazaar p a b a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0
(a ~ b, Conjoined p) => ComonadApply (Bazaar p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods (<@>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 (@>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 (<@) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0
Apply (Bazaar p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods (<.>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 (.>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 (<.) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 liftF2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c

type Setter s t a b = forall (f :: Type -> Type). Settable f => (a -> f b) -> s -> f t Source #

The only `LensLike` law that can apply to a `Setter` `l` is that

    set l y (set l x a) ≡ set l y a

You can't `view` a `Setter` in general, so the other two laws are irrelevant.

However, two `Functor` laws apply to a `Setter`:

    over l id ≡ id
    over l f . over l g ≡ over l (f . g)

These can be stated more directly:

    l pure ≡ pure
    l f . untainted . l g ≡ l (f . untainted . g)

You can compose a `Setter` with a `Lens` or a `Traversal` using (`.`) from the `Prelude` and the result is always only a `Setter` and nothing more.

    >>> over traverse f [a,b,c,d]
    [f a,f b,f c,f d]

    >>> over _1 f (a,b)
    (f a,b)

    >>> over (traverse._1) f [(a,b),(c,d)]
    [(f a,b),(f c,d)]

    >>> over both f (a,b)
    (f a,f b)

    >>> over (traverse.both) f [(a,b),(c,d)]
    [(f a,f b),(f c,f d)]

class (MonadState s m, MonadState t n) => Zoom (m :: Type -> Type) (n :: Type -> Type) s t | m -> s, n -> t, m t -> n, n s -> m where Source #

This class allows us to use `zoom` in, changing the `State` supplied by many different `Monad` transformers, potentially quite deep in a `Monad` transformer stack.

Methods

zoom :: LensLike' (Zoomed m c) t s -> m c -> n c infixr 2 Source #

Run a monadic action in a larger `State` than it was defined in, using a `Lens'` or `Traversal'`.

This is commonly used to lift actions in a simpler `State` `Monad` into a `State` `Monad` with a larger `State` type.

When applied to a `Traversal'` over multiple values, the actions for each target are executed sequentially and the results are aggregated.

This can be used to edit pretty much any `Monad` transformer stack with a `State` in it!

    >>> flip State.evalState (a,b) $ zoom _1 $ use id
    a

    >>> flip State.execState (a,b) $ zoom _1 $ id .= c
    (c,b)

    >>> flip State.execState [(a,b),(c,d)] $ zoom traverse $ _2 %= f
    [(a,f b),(c,f d)]

    >>> flip State.runState [(a,b),(c,d)] $ zoom traverse $ _2 <%= f
    (f b <> f d <> mempty,[(a,f b),(c,f d)])

    >>> flip State.evalState (a,b) $ zoom both (use id)
    a <> b

    zoom :: Monad m             => Lens' s t      -> StateT t m a -> StateT s m a
    zoom :: (Monad m, Monoid c) => Traversal' s t -> StateT t m c -> StateT s m c
    zoom :: (Monad m, Monoid w)             => Lens' s t      -> RWST r w t m c -> RWST r w s m c
    zoom :: (Monad m, Monoid w, Monoid c) => Traversal' s t -> RWST r w t m c -> RWST r w s m c
    zoom :: (Monad m, Monoid w, Error e)  => Lens' s t      -> ErrorT e (RWST r w t m) c -> ErrorT e (RWST r w s m) c
    zoom :: (Monad m, Monoid w, Monoid c, Error e) => Traversal' s t -> ErrorT e (RWST r w t m) c -> ErrorT e (RWST r w s m) c
    ...

#### Instances

Instances details

Zoom m n s t => Zoom (ListT m) (ListT n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (ListT m) c) t s -> ListT m c -> ListT n c Source #
Zoom m n s t => Zoom (MaybeT m) (MaybeT n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (MaybeT m) c) t s -> MaybeT m c -> MaybeT n c Source #
(Functor f, Zoom m n s t) => Zoom (FreeT f m) (FreeT f n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (FreeT f m) c) t s -> FreeT f m c -> FreeT f n c Source #
(Error e, Zoom m n s t) => Zoom (ErrorT e m) (ErrorT e n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (ErrorT e m) c) t s -> ErrorT e m c -> ErrorT e n c Source #
Zoom m n s t => Zoom (ExceptT e m) (ExceptT e n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (ExceptT e m) c) t s -> ExceptT e m c -> ExceptT e n c Source #
Zoom m n s t => Zoom (IdentityT m) (IdentityT n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (IdentityT m) c) t s -> IdentityT m c -> IdentityT n c Source #
Zoom m n s t => Zoom (ReaderT e m) (ReaderT e n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (ReaderT e m) c) t s -> ReaderT e m c -> ReaderT e n c Source #
Monad z => Zoom (StateT s z) (StateT t z) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (StateT s z) c) t s -> StateT s z c -> StateT t z c Source #
Monad z => Zoom (StateT s z) (StateT t z) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (StateT s z) c) t s -> StateT s z c -> StateT t z c Source #
(Monoid w, Zoom m n s t) => Zoom (WriterT w m) (WriterT w n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (WriterT w m) c) t s -> WriterT w m c -> WriterT w n c Source #
(Monoid w, Zoom m n s t) => Zoom (WriterT w m) (WriterT w n) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (WriterT w m) c) t s -> WriterT w m c -> WriterT w n c Source #
(Monoid w, Monad z) => Zoom (RWST r w s z) (RWST r w t z) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (RWST r w s z) c) t s -> RWST r w s z c -> RWST r w t z c Source #
(Monoid w, Monad z) => Zoom (RWST r w s z) (RWST r w t z) s t |
Instance details Defined in Control.Lens.Zoom Methods zoom :: LensLike' (Zoomed (RWST r w s z) c) t s -> RWST r w s z c -> RWST r w t z c Source #

type Getting r s a = (a -> Const r a) -> s -> Const r s Source #

When you see this in a type signature it indicates that you can pass the function a `Lens`, `Getter`, `Traversal`, `Fold`, `Prism`, `Iso`, or one of the indexed variants, and it will just "do the right thing".

Most `Getter` combinators are able to be used with both a `Getter` or a `Fold` in limited situations, to do so, they need to be monomorphic in what we are going to extract with `Const`. To be compatible with `Lens`, `Traversal` and `Iso` we also restricted choices of the irrelevant `t` and `b` parameters.

If a function accepts a ``Getting` r s a`, then when `r` is a `Monoid`, then you can pass a `Fold` (or `Traversal`), otherwise you can only pass this a `Getter` or `Lens`.

type Traversal' s a = Traversal s s a a Source #

    type Traversal' = Simple Traversal

type Setter' s a = Setter s s a a Source #

A `Setter'` is just a `Setter` that doesn't change the types.

These are particularly common when talking about monomorphic containers. e.g.

    sets Data.Text.map :: Setter' Text Char

    type Setter' = Simple Setter

type Iso' s a = Iso s s a a Source #

    type Iso' = Simple Iso

class AsEmpty a where Source #

Minimal complete definition

Nothing

Methods

_Empty :: Prism' a () Source #

    >>> isn't _Empty [1,2,3]
    True

#### Instances

Instances details

AsEmpty All |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' All () Source #
AsEmpty Any |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' Any () Source #
AsEmpty Event |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' Event () Source #
AsEmpty ByteString |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' ByteString () Source #
AsEmpty ByteString |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' ByteString () Source #
AsEmpty IntSet |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' IntSet () Source #
AsEmpty Ordering |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' Ordering () Source #
AsEmpty Text |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' Text () Source #
AsEmpty Text |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' Text () Source #
AsEmpty () |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' () () Source #
AsEmpty (ZipList a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (ZipList a) () Source #
AsEmpty (First a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (First a) () Source #
AsEmpty (Last a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Last a) () Source #
AsEmpty a => AsEmpty (Dual a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Dual a) () Source #
(Eq a, Num a) => AsEmpty (Product a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Product a) () Source #
(Eq a, Num a) => AsEmpty (Sum a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Sum a) () Source #
AsEmpty (IntMap a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (IntMap a) () Source #
AsEmpty (Seq a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Seq a) () Source #
AsEmpty (Set a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Set a) () Source #
AsEmpty (Clip n) Source # |
Instance details Defined in Diagrams.TwoD.Path Methods _Empty :: Prism' (Clip n) () Source #
AsEmpty (HashSet a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (HashSet a) () Source #
AsEmpty (Vector a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Vector a) () Source #
Storable a => AsEmpty (Vector a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Vector a) () Source #
Unbox a => AsEmpty (Vector a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Vector a) () Source #
AsEmpty (Maybe a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Maybe a) () Source #
AsEmpty [a] |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' [a] () Source #
AsEmpty (Map k a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (Map k a) () Source #
AsEmpty (BoundingBox v n) Source # |
Instance details Defined in Diagrams.BoundingBox Methods _Empty :: Prism' (BoundingBox v n) () Source #
AsEmpty (Path v n) Source # |
Instance details Defined in Diagrams.Path Methods _Empty :: Prism' (Path v n) () Source #
(Metric v, OrderedField n) => AsEmpty (Trail v n) Source # |
Instance details Defined in Diagrams.Trail Methods _Empty :: Prism' (Trail v n) () Source #
AsEmpty (HashMap k a) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (HashMap k a) () Source #
(AsEmpty a, AsEmpty b) => AsEmpty (a, b) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (a, b) () Source #
(Metric v, OrderedField n) => AsEmpty (Trail' Line v n) Source # |
Instance details Defined in Diagrams.Trail Methods _Empty :: Prism' (Trail' Line v n) () Source #
(AsEmpty a, AsEmpty b, AsEmpty c) => AsEmpty (a, b, c) |
Instance details Defined in Control.Lens.Empty Methods _Empty :: Prism' (a, b, c) () Source #

newtype ReifiedTraversal s t a b Source #

A form of `Traversal` that can be stored monomorphically in a container.

Constructors

Traversal |

Fields

- runTraversal :: Traversal s t a b

type Prism' s a = Prism s s a a Source #

A `Simple` `Prism`.

type Lens' s a = Lens s s a a Source #

    type Lens' = Simple Lens

newtype Indexed i a b Source #

A function with access to a index. This constructor may be useful when you need to store an `Indexable` in a container to avoid `ImpredicativeTypes`.

    index :: Indexed i a b -> i -> a -> b

Constructors

Indexed |

Fields

- runIndexed :: i -> a -> b

#### Instances

Instances details

Category (Indexed i :: Type -> Type -> Type) |
Instance details Defined in Control.Lens.Internal.Indexed Methods id :: forall (a :: k). Indexed i a a Source # (.) :: forall (b :: k) (c :: k) (a :: k). Indexed i b c -> Indexed i a b -> Indexed i a c Source #
i ~ j => Indexable i (Indexed j) |
Instance details Defined in Control.Lens.Internal.Indexed Methods indexed :: Indexed j a b -> i -> a -> b Source #
Arrow (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods arr :: (b -> c) -> Indexed i b c Source # first :: Indexed i b c -> Indexed i (b, d) (c, d) Source # second :: Indexed i b c -> Indexed i (d, b) (d, c) Source # (***) :: Indexed i b c -> Indexed i b' c' -> Indexed i (b, b') (c, c') Source # (&&&) :: Indexed i b c -> Indexed i b c' -> Indexed i b (c, c') Source #
ArrowApply (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods app :: Indexed i (Indexed i b c, b) c Source #
ArrowChoice (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods left :: Indexed i b c -> Indexed i (Either b d) (Either c d) Source # right :: Indexed i b c -> Indexed i (Either d b) (Either d c) Source # (+++) :: Indexed i b c -> Indexed i b' c' -> Indexed i (Either b b') (Either c c') Source # (|||) :: Indexed i b d -> Indexed i c d -> Indexed i (Either b c) d Source #
ArrowLoop (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods loop :: Indexed i (b, d) (c, d) -> Indexed i b c Source #
Conjoined (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods distrib :: Functor f => Indexed i a b -> Indexed i (f a) (f b) Source # conjoined :: (Indexed i ~ (->) => q (a -> b) r) -> q (Indexed i a b) r -> q (Indexed i a b) r Source #
Choice (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods left' :: Indexed i a b -> Indexed i (Either a c) (Either b c) Source # right' :: Indexed i a b -> Indexed i (Either c a) (Either c b) Source #
Closed (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods closed :: Indexed i a b -> Indexed i (x -> a) (x -> b) Source #
Corepresentable (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Associated Types type Corep (Indexed i) :: Type -> Type Source # Methods cotabulate :: (Corep (Indexed i) d -> c) -> Indexed i d c Source #
Representable (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Associated Types type Rep (Indexed i) :: Type -> Type Source # Methods tabulate :: (d -> Rep (Indexed i) c) -> Indexed i d c Source #
Costrong (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods unfirst :: Indexed i (a, d) (b, d) -> Indexed i a b Source # unsecond :: Indexed i (d, a) (d, b) -> Indexed i a b Source #
Strong (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods first' :: Indexed i a b -> Indexed i (a, c) (b, c) Source # second' :: Indexed i a b -> Indexed i (c, a) (c, b) Source #
Profunctor (Indexed i) |

Instance details

Defined in Control.Lens.Internal.Indexed

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d Source #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c Source #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Indexed i a b -> Indexed i a c Source #

(.#) :: forall a b c q. Coercible b a => Indexed i b c -> q a b -> Indexed i a c Source #

Bizarre (Indexed Int) Mafic |
Instance details Defined in Control.Lens.Internal.Magma Methods bazaar :: Applicative f => Indexed Int a (f b) -> Mafic a b t -> f t Source #
Bizarre (Indexed i) (Molten i) |
Instance details Defined in Control.Lens.Internal.Magma Methods bazaar :: Applicative f => Indexed i a (f b) -> Molten i a b t -> f t Source #
Sellable (Indexed i) (Molten i) |
Instance details Defined in Control.Lens.Internal.Magma Methods sell :: Indexed i a (Molten i a b b) Source #
Cosieve (Indexed i) ((,) i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods cosieve :: Indexed i a b -> (i, a) -> b Source #
Sieve (Indexed i) ((->) i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods sieve :: Indexed i a b -> a -> i -> b Source #
MonadFix (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods mfix :: (a0 -> Indexed i a a0) -> Indexed i a a0 Source #
Applicative (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods pure :: a0 -> Indexed i a a0 Source # (<*>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b Source # liftA2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c Source # (*>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b Source # (<*) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 Source #
Functor (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods fmap :: (a0 -> b) -> Indexed i a a0 -> Indexed i a b Source # (<$) :: a0 -> Indexed i a b -> Indexed i a a0 Source #
Monad (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods (>>=) :: Indexed i a a0 -> (a0 -> Indexed i a b) -> Indexed i a b Source # (>>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b Source # return :: a0 -> Indexed i a a0 Source #
Apply (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods (<.>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b (.>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b (<.) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 liftF2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c
Bind (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods (>>-) :: Indexed i a a0 -> (a0 -> Indexed i a b) -> Indexed i a b join :: Indexed i a (Indexed i a a0) -> Indexed i a a0
type Corep (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed type Corep (Indexed i) = (,) i
type Rep (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed type Rep (Indexed i) = (->) i

type Simple (f :: k1 -> k1 -> k2 -> k2 -> k) (s :: k1) (a :: k2) = f s s a a Source #

A `Simple` `Lens`, `Simple` `Traversal`, ... can be used instead of a `Lens`,`Traversal`, ... whenever the type variables don't change upon setting a value.

    _imagPart :: Simple Lens (Complex a) a
    traversed :: Simple (IndexedTraversal Int) [a] a

Note: To use this alias in your own code with ``LensLike` f` or `Setter`, you may have to turn on `LiberalTypeSynonyms`.

This is commonly abbreviated as a "prime" marker, e.g. `Lens'` = `Simple` `Lens`.

class Wrapped s where Source #

`Wrapped` provides isomorphisms to wrap and unwrap newtypes or data types with one constructor.

Minimal complete definition

Nothing

Associated Types

type Unwrapped s Source #

type Unwrapped s = GUnwrapped (Rep s)

Methods

_Wrapped' :: Iso' s (Unwrapped s) Source #

An isomorphism between `s` and `a`.

If your type has a `Generic` instance, `_Wrapped'` will default to `_GWrapped'`, and you can choose to not override it with your own definition.

#### Instances

Instances details

Wrapped NoMethodError |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped NoMethodError Source # Methods _Wrapped' :: Iso' NoMethodError (Unwrapped NoMethodError) Source #
Wrapped PatternMatchFail |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped PatternMatchFail Source # Methods _Wrapped' :: Iso' PatternMatchFail (Unwrapped PatternMatchFail) Source #
Wrapped RecConError |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped RecConError Source # Methods _Wrapped' :: Iso' RecConError (Unwrapped RecConError) Source #
Wrapped RecSelError |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped RecSelError Source # Methods _Wrapped' :: Iso' RecSelError (Unwrapped RecSelError) Source #
Wrapped RecUpdError |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped RecUpdError Source # Methods _Wrapped' :: Iso' RecUpdError (Unwrapped RecUpdError) Source #
Wrapped TypeError |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped TypeError Source # Methods _Wrapped' :: Iso' TypeError (Unwrapped TypeError) Source #
Wrapped All |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped All Source # Methods _Wrapped' :: Iso' All (Unwrapped All) Source #
Wrapped Any |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped Any Source # Methods _Wrapped' :: Iso' Any (Unwrapped Any) Source #
Wrapped Errno |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped Errno Source # Methods _Wrapped' :: Iso' Errno (Unwrapped Errno) Source #
Wrapped CBool |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CBool Source # Methods _Wrapped' :: Iso' CBool (Unwrapped CBool) Source #
Wrapped CChar |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CChar Source # Methods _Wrapped' :: Iso' CChar (Unwrapped CChar) Source #
Wrapped CClock |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CClock Source # Methods _Wrapped' :: Iso' CClock (Unwrapped CClock) Source #
Wrapped CDouble |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CDouble Source # Methods _Wrapped' :: Iso' CDouble (Unwrapped CDouble) Source #
Wrapped CFloat |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CFloat Source # Methods _Wrapped' :: Iso' CFloat (Unwrapped CFloat) Source #
Wrapped CInt |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CInt Source # Methods _Wrapped' :: Iso' CInt (Unwrapped CInt) Source #
Wrapped CIntMax |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CIntMax Source # Methods _Wrapped' :: Iso' CIntMax (Unwrapped CIntMax) Source #
Wrapped CIntPtr |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CIntPtr Source # Methods _Wrapped' :: Iso' CIntPtr (Unwrapped CIntPtr) Source #
Wrapped CLLong |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CLLong Source # Methods _Wrapped' :: Iso' CLLong (Unwrapped CLLong) Source #
Wrapped CLong |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CLong Source # Methods _Wrapped' :: Iso' CLong (Unwrapped CLong) Source #
Wrapped CPtrdiff |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CPtrdiff Source # Methods _Wrapped' :: Iso' CPtrdiff (Unwrapped CPtrdiff) Source #
Wrapped CSChar |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CSChar Source # Methods _Wrapped' :: Iso' CSChar (Unwrapped CSChar) Source #
Wrapped CSUSeconds |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CSUSeconds Source # Methods _Wrapped' :: Iso' CSUSeconds (Unwrapped CSUSeconds) Source #
Wrapped CShort |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CShort Source # Methods _Wrapped' :: Iso' CShort (Unwrapped CShort) Source #
Wrapped CSigAtomic |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CSigAtomic Source # Methods _Wrapped' :: Iso' CSigAtomic (Unwrapped CSigAtomic) Source #
Wrapped CSize |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CSize Source # Methods _Wrapped' :: Iso' CSize (Unwrapped CSize) Source #
Wrapped CTime |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CTime Source # Methods _Wrapped' :: Iso' CTime (Unwrapped CTime) Source #
Wrapped CUChar |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUChar Source # Methods _Wrapped' :: Iso' CUChar (Unwrapped CUChar) Source #
Wrapped CUInt |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUInt Source # Methods _Wrapped' :: Iso' CUInt (Unwrapped CUInt) Source #
Wrapped CUIntMax |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUIntMax Source # Methods _Wrapped' :: Iso' CUIntMax (Unwrapped CUIntMax) Source #
Wrapped CUIntPtr |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUIntPtr Source # Methods _Wrapped' :: Iso' CUIntPtr (Unwrapped CUIntPtr) Source #
Wrapped CULLong |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CULLong Source # Methods _Wrapped' :: Iso' CULLong (Unwrapped CULLong) Source #
Wrapped CULong |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CULong Source # Methods _Wrapped' :: Iso' CULong (Unwrapped CULong) Source #
Wrapped CUSeconds |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUSeconds Source # Methods _Wrapped' :: Iso' CUSeconds (Unwrapped CUSeconds) Source #
Wrapped CUShort |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUShort Source # Methods _Wrapped' :: Iso' CUShort (Unwrapped CUShort) Source #
Wrapped CWchar |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CWchar Source # Methods _Wrapped' :: Iso' CWchar (Unwrapped CWchar) Source #
Wrapped ErrorCall |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped ErrorCall Source # Methods _Wrapped' :: Iso' ErrorCall (Unwrapped ErrorCall) Source #
Wrapped AssertionFailed |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped AssertionFailed Source # Methods _Wrapped' :: Iso' AssertionFailed (Unwrapped AssertionFailed) Source #
Wrapped CompactionFailed |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CompactionFailed Source # Methods _Wrapped' :: Iso' CompactionFailed (Unwrapped CompactionFailed) Source #
Wrapped CBlkCnt |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CBlkCnt Source # Methods _Wrapped' :: Iso' CBlkCnt (Unwrapped CBlkCnt) Source #
Wrapped CBlkSize |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CBlkSize Source # Methods _Wrapped' :: Iso' CBlkSize (Unwrapped CBlkSize) Source #
Wrapped CCc |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CCc Source # Methods _Wrapped' :: Iso' CCc (Unwrapped CCc) Source #
Wrapped CClockId |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CClockId Source # Methods _Wrapped' :: Iso' CClockId (Unwrapped CClockId) Source #
Wrapped CDev |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CDev Source # Methods _Wrapped' :: Iso' CDev (Unwrapped CDev) Source #
Wrapped CFsBlkCnt |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CFsBlkCnt Source # Methods _Wrapped' :: Iso' CFsBlkCnt (Unwrapped CFsBlkCnt) Source #
Wrapped CFsFilCnt |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CFsFilCnt Source # Methods _Wrapped' :: Iso' CFsFilCnt (Unwrapped CFsFilCnt) Source #
Wrapped CGid |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CGid Source # Methods _Wrapped' :: Iso' CGid (Unwrapped CGid) Source #
Wrapped CId |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CId Source # Methods _Wrapped' :: Iso' CId (Unwrapped CId) Source #
Wrapped CIno |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CIno Source # Methods _Wrapped' :: Iso' CIno (Unwrapped CIno) Source #
Wrapped CKey |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CKey Source # Methods _Wrapped' :: Iso' CKey (Unwrapped CKey) Source #
Wrapped CMode |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CMode Source # Methods _Wrapped' :: Iso' CMode (Unwrapped CMode) Source #
Wrapped CNlink |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CNlink Source # Methods _Wrapped' :: Iso' CNlink (Unwrapped CNlink) Source #
Wrapped COff |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped COff Source # Methods _Wrapped' :: Iso' COff (Unwrapped COff) Source #
Wrapped CPid |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CPid Source # Methods _Wrapped' :: Iso' CPid (Unwrapped CPid) Source #
Wrapped CRLim |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CRLim Source # Methods _Wrapped' :: Iso' CRLim (Unwrapped CRLim) Source #
Wrapped CSpeed |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CSpeed Source # Methods _Wrapped' :: Iso' CSpeed (Unwrapped CSpeed) Source #
Wrapped CSsize |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CSsize Source # Methods _Wrapped' :: Iso' CSsize (Unwrapped CSsize) Source #
Wrapped CTcflag |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CTcflag Source # Methods _Wrapped' :: Iso' CTcflag (Unwrapped CTcflag) Source #
Wrapped CTimer |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CTimer Source # Methods _Wrapped' :: Iso' CTimer (Unwrapped CTimer) Source #
Wrapped CUid |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped CUid Source # Methods _Wrapped' :: Iso' CUid (Unwrapped CUid) Source #
Wrapped Fd |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped Fd Source # Methods _Wrapped' :: Iso' Fd (Unwrapped Fd) Source #
Wrapped IntSet |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped IntSet Source # Methods _Wrapped' :: Iso' IntSet (Unwrapped IntSet) Source #
Wrapped Name |
Instance details Defined in Diagrams.Core.Names Associated Types type Unwrapped Name Source # Methods _Wrapped' :: Iso' Name (Unwrapped Name) Source #
Wrapped SegCount Source # |
Instance details Defined in Diagrams.Segment Associated Types type Unwrapped SegCount Source # Methods _Wrapped' :: Iso' SegCount (Unwrapped SegCount) Source #
Wrapped (Active a) |
Instance details Defined in Data.Active Associated Types type Unwrapped (Active a) Source # Methods _Wrapped' :: Iso' (Active a) (Unwrapped (Active a)) Source #
Wrapped (Duration n) |
Instance details Defined in Data.Active Associated Types type Unwrapped (Duration n) Source # Methods _Wrapped' :: Iso' (Duration n) (Unwrapped (Duration n)) Source #
Wrapped (Time n) |
Instance details Defined in Data.Active Associated Types type Unwrapped (Time n) Source # Methods _Wrapped' :: Iso' (Time n) (Unwrapped (Time n)) Source #
Wrapped (ZipList a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ZipList a) Source # Methods _Wrapped' :: Iso' (ZipList a) (Unwrapped (ZipList a)) Source #
Wrapped (Comparison a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Comparison a) Source # Methods _Wrapped' :: Iso' (Comparison a) (Unwrapped (Comparison a)) Source #
Wrapped (Equivalence a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Equivalence a) Source # Methods _Wrapped' :: Iso' (Equivalence a) (Unwrapped (Equivalence a)) Source #
Wrapped (Predicate a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Predicate a) Source # Methods _Wrapped' :: Iso' (Predicate a) (Unwrapped (Predicate a)) Source #
Wrapped (Identity a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Identity a) Source # Methods _Wrapped' :: Iso' (Identity a) (Unwrapped (Identity a)) Source #
Wrapped (First a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (First a) Source # Methods _Wrapped' :: Iso' (First a) (Unwrapped (First a)) Source #
Wrapped (Last a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Last a) Source # Methods _Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) Source #
Wrapped (Down a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Down a) Source # Methods _Wrapped' :: Iso' (Down a) (Unwrapped (Down a)) Source #
Wrapped (First a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (First a) Source # Methods _Wrapped' :: Iso' (First a) (Unwrapped (First a)) Source #
Wrapped (Last a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Last a) Source # Methods _Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) Source #
Wrapped (Max a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Max a) Source # Methods _Wrapped' :: Iso' (Max a) (Unwrapped (Max a)) Source #
Wrapped (Min a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Min a) Source # Methods _Wrapped' :: Iso' (Min a) (Unwrapped (Min a)) Source #
Wrapped (WrappedMonoid a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedMonoid a) Source # Methods _Wrapped' :: Iso' (WrappedMonoid a) (Unwrapped (WrappedMonoid a)) Source #
Wrapped (Dual a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Dual a) Source # Methods _Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) Source #
Wrapped (Endo a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Endo a) Source # Methods _Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) Source #
Wrapped (Product a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Product a) Source # Methods _Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) Source #
Wrapped (Sum a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Sum a) Source # Methods _Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) Source #
Wrapped (Par1 p) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Par1 p) Source # Methods _Wrapped' :: Iso' (Par1 p) (Unwrapped (Par1 p)) Source #
Wrapped (IntMap a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (IntMap a) Source # Methods _Wrapped' :: Iso' (IntMap a) (Unwrapped (IntMap a)) Source #
Wrapped (Seq a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Seq a) Source # Methods _Wrapped' :: Iso' (Seq a) (Unwrapped (Seq a)) Source #
Ord a => Wrapped (Set a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Set a) Source # Methods _Wrapped' :: Iso' (Set a) (Unwrapped (Set a)) Source #
Wrapped (TransInv t) |
Instance details Defined in Diagrams.Core.Transform Associated Types type Unwrapped (TransInv t) Source # Methods _Wrapped' :: Iso' (TransInv t) (Unwrapped (TransInv t)) Source #
Wrapped (ArcLength n) Source # |
Instance details Defined in Diagrams.Segment Associated Types type Unwrapped (ArcLength n) Source # Methods _Wrapped' :: Iso' (ArcLength n) (Unwrapped (ArcLength n)) Source #
Wrapped (Clip n) Source # |
Instance details Defined in Diagrams.TwoD.Path Associated Types type Unwrapped (Clip n) Source # Methods _Wrapped' :: Iso' (Clip n) (Unwrapped (Clip n)) Source #
(Hashable a, Eq a) => Wrapped (HashSet a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (HashSet a) Source # Methods _Wrapped' :: Iso' (HashSet a) (Unwrapped (HashSet a)) Source #
Wrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Vector a) Source # Methods _Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) Source #
Prim a => Wrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Vector a) Source # Methods _Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) Source #
Storable a => Wrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Vector a) Source # Methods _Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) Source #
Unbox a => Wrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Vector a) Source # Methods _Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) Source #
Wrapped (NonEmpty a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (NonEmpty a) Source # Methods _Wrapped' :: Iso' (NonEmpty a) (Unwrapped (NonEmpty a)) Source #
Wrapped (WrappedMonad m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedMonad m a) Source # Methods _Wrapped' :: Iso' (WrappedMonad m a) (Unwrapped (WrappedMonad m a)) Source #
Wrapped (ArrowMonad m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ArrowMonad m a) Source # Methods _Wrapped' :: Iso' (ArrowMonad m a) (Unwrapped (ArrowMonad m a)) Source #
Wrapped (Op a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Op a b) Source # Methods _Wrapped' :: Iso' (Op a b) (Unwrapped (Op a b)) Source #
Ord k => Wrapped (Map k a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Map k a) Source # Methods _Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) Source #
Wrapped (Envelope v n) |
Instance details Defined in Diagrams.Core.Envelope Associated Types type Unwrapped (Envelope v n) Source # Methods _Wrapped' :: Iso' (Envelope v n) (Unwrapped (Envelope v n)) Source #
Wrapped (Style v n) |
Instance details Defined in Diagrams.Core.Style Associated Types type Unwrapped (Style v n) Source # Methods _Wrapped' :: Iso' (Style v n) (Unwrapped (Style v n)) Source #
Wrapped (Trace v n) |
Instance details Defined in Diagrams.Core.Trace Associated Types type Unwrapped (Trace v n) Source # Methods _Wrapped' :: Iso' (Trace v n) (Unwrapped (Trace v n)) Source #
Wrapped (Path v n) Source # |
Instance details Defined in Diagrams.Path Associated Types type Unwrapped (Path v n) Source # Methods _Wrapped' :: Iso' (Path v n) (Unwrapped (Path v n)) Source #
Wrapped (TotalOffset v n) Source # |
Instance details Defined in Diagrams.Segment Associated Types type Unwrapped (TotalOffset v n) Source # Methods _Wrapped' :: Iso' (TotalOffset v n) (Unwrapped (TotalOffset v n)) Source #
Wrapped (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail Associated Types type Unwrapped (SegTree v n) Source # Methods _Wrapped' :: Iso' (SegTree v n) (Unwrapped (SegTree v n)) Source #
Wrapped (Trail v n) Source # |
Instance details Defined in Diagrams.Trail Associated Types type Unwrapped (Trail v n) Source # Methods _Wrapped' :: Iso' (Trail v n) (Unwrapped (Trail v n)) Source #
Wrapped (CatchT m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (CatchT m a) Source # Methods _Wrapped' :: Iso' (CatchT m a) (Unwrapped (CatchT m a)) Source #
Wrapped (Alt f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Alt f a) Source # Methods _Wrapped' :: Iso' (Alt f a) (Unwrapped (Alt f a)) Source #
Wrapped (CoiterT w a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (CoiterT w a) Source # Methods _Wrapped' :: Iso' (CoiterT w a) (Unwrapped (CoiterT w a)) Source #
Wrapped (IterT m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (IterT m a) Source # Methods _Wrapped' :: Iso' (IterT m a) (Unwrapped (IterT m a)) Source #
Wrapped (Point f a) |
Instance details Defined in Linear.Affine Associated Types type Unwrapped (Point f a) Source # Methods _Wrapped' :: Iso' (Point f a) (Unwrapped (Point f a)) Source #
Wrapped (MaybeApply f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (MaybeApply f a) Source # Methods _Wrapped' :: Iso' (MaybeApply f a) (Unwrapped (MaybeApply f a)) Source #
Wrapped (WrappedApplicative f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedApplicative f a) Source # Methods _Wrapped' :: Iso' (WrappedApplicative f a) (Unwrapped (WrappedApplicative f a)) Source #
Wrapped (ListT m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ListT m a) Source # Methods _Wrapped' :: Iso' (ListT m a) (Unwrapped (ListT m a)) Source #
Wrapped (MaybeT m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (MaybeT m a) Source # Methods _Wrapped' :: Iso' (MaybeT m a) (Unwrapped (MaybeT m a)) Source #
(Hashable k, Eq k) => Wrapped (HashMap k a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (HashMap k a) Source # Methods _Wrapped' :: Iso' (HashMap k a) (Unwrapped (HashMap k a)) Source #
Wrapped (WrappedArrow a b c) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedArrow a b c) Source # Methods _Wrapped' :: Iso' (WrappedArrow a b c) (Unwrapped (WrappedArrow a b c)) Source #
Wrapped (Kleisli m a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Kleisli m a b) Source # Methods _Wrapped' :: Iso' (Kleisli m a b) (Unwrapped (Kleisli m a b)) Source #
Wrapped (Const a x) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Const a x) Source # Methods _Wrapped' :: Iso' (Const a x) (Unwrapped (Const a x)) Source #
Wrapped (Ap f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Ap f a) Source # Methods _Wrapped' :: Iso' (Ap f a) (Unwrapped (Ap f a)) Source #
Wrapped (Alt f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Alt f a) Source # Methods _Wrapped' :: Iso' (Alt f a) (Unwrapped (Alt f a)) Source #
Wrapped (Rec1 f p) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Rec1 f p) Source # Methods _Wrapped' :: Iso' (Rec1 f p) (Unwrapped (Rec1 f p)) Source #
Wrapped (Fix p a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Fix p a) Source # Methods _Wrapped' :: Iso' (Fix p a) (Unwrapped (Fix p a)) Source #
Wrapped (Join p a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Join p a) Source # Methods _Wrapped' :: Iso' (Join p a) (Unwrapped (Join p a)) Source #
Wrapped (TracedT m w a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (TracedT m w a) Source # Methods _Wrapped' :: Iso' (TracedT m w a) (Unwrapped (TracedT m w a)) Source #
Wrapped (Compose f g a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Compose f g a) Source # Methods _Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) Source #
Wrapped (ComposeCF f g a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ComposeCF f g a) Source # Methods _Wrapped' :: Iso' (ComposeCF f g a) (Unwrapped (ComposeCF f g a)) Source #
Wrapped (ComposeFC f g a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ComposeFC f g a) Source # Methods _Wrapped' :: Iso' (ComposeFC f g a) (Unwrapped (ComposeFC f g a)) Source #
Wrapped (Query v n m) |
Instance details Defined in Diagrams.Core.Query Associated Types type Unwrapped (Query v n m) Source # Methods _Wrapped' :: Iso' (Query v n m) (Unwrapped (Query v n m)) Source #
Wrapped (Trail' Line v n) Source # |
Instance details Defined in Diagrams.Trail Associated Types type Unwrapped (Trail' Line v n) Source # Methods _Wrapped' :: Iso' (Trail' Line v n) (Unwrapped (Trail' Line v n)) Source #
Wrapped (ApT f g a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ApT f g a) Source # Methods _Wrapped' :: Iso' (ApT f g a) (Unwrapped (ApT f g a)) Source #
Wrapped (CofreeT f w a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (CofreeT f w a) Source # Methods _Wrapped' :: Iso' (CofreeT f w a) (Unwrapped (CofreeT f w a)) Source #
Wrapped (FreeT f m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (FreeT f m a) Source # Methods _Wrapped' :: Iso' (FreeT f m a) (Unwrapped (FreeT f m a)) Source #
Wrapped (Static f a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Static f a b) Source # Methods _Wrapped' :: Iso' (Static f a b) (Unwrapped (Static f a b)) Source #
Wrapped (Tagged s a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Tagged s a) Source # Methods _Wrapped' :: Iso' (Tagged s a) (Unwrapped (Tagged s a)) Source #
Wrapped (Backwards f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Backwards f a) Source # Methods _Wrapped' :: Iso' (Backwards f a) (Unwrapped (Backwards f a)) Source #
Wrapped (ErrorT e m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ErrorT e m a) Source # Methods _Wrapped' :: Iso' (ErrorT e m a) (Unwrapped (ErrorT e m a)) Source #
Wrapped (ExceptT e m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ExceptT e m a) Source # Methods _Wrapped' :: Iso' (ExceptT e m a) (Unwrapped (ExceptT e m a)) Source #
Wrapped (IdentityT m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (IdentityT m a) Source # Methods _Wrapped' :: Iso' (IdentityT m a) (Unwrapped (IdentityT m a)) Source #
Wrapped (ReaderT r m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ReaderT r m a) Source # Methods _Wrapped' :: Iso' (ReaderT r m a) (Unwrapped (ReaderT r m a)) Source #
Wrapped (StateT s m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (StateT s m a) Source # Methods _Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) Source #
Wrapped (StateT s m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (StateT s m a) Source # Methods _Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) Source #
Wrapped (WriterT w m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WriterT w m a) Source # Methods _Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) Source #
Wrapped (WriterT w m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WriterT w m a) Source # Methods _Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) Source #
Wrapped (Constant a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Constant a b) Source # Methods _Wrapped' :: Iso' (Constant a b) (Unwrapped (Constant a b)) Source #
Wrapped (Reverse f a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Reverse f a) Source # Methods _Wrapped' :: Iso' (Reverse f a) (Unwrapped (Reverse f a)) Source #
Wrapped (K1 i c p) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (K1 i c p) Source # Methods _Wrapped' :: Iso' (K1 i c p) (Unwrapped (K1 i c p)) Source #
Wrapped (QDiagram b v n m) |
Instance details Defined in Diagrams.Core.Types Associated Types type Unwrapped (QDiagram b v n m) Source # Methods _Wrapped' :: Iso' (QDiagram b v n m) (Unwrapped (QDiagram b v n m)) Source #
Wrapped (SubMap b v n m) |
Instance details Defined in Diagrams.Core.Types Associated Types type Unwrapped (SubMap b v n m) Source # Methods _Wrapped' :: Iso' (SubMap b v n m) (Unwrapped (SubMap b v n m)) Source #
Wrapped (Costar f d c) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Costar f d c) Source # Methods _Wrapped' :: Iso' (Costar f d c) (Unwrapped (Costar f d c)) Source #
Wrapped (Forget r a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Forget r a b) Source # Methods _Wrapped' :: Iso' (Forget r a b) (Unwrapped (Forget r a b)) Source #
Wrapped (Star f d c) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Star f d c) Source # Methods _Wrapped' :: Iso' (Star f d c) (Unwrapped (Star f d c)) Source #
Wrapped (ContT r m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (ContT r m a) Source # Methods _Wrapped' :: Iso' (ContT r m a) (Unwrapped (ContT r m a)) Source #
Wrapped (Compose f g a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Compose f g a) Source # Methods _Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) Source #
Wrapped ((f :.: g) p) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped ((f :.: g) p) Source # Methods _Wrapped' :: Iso' ((f :.: g) p) (Unwrapped ((f :.: g) p)) Source #
Wrapped (M1 i c f p) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (M1 i c f p) Source # Methods _Wrapped' :: Iso' (M1 i c f p) (Unwrapped (M1 i c f p)) Source #
Wrapped (Clown f a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Clown f a b) Source # Methods _Wrapped' :: Iso' (Clown f a b) (Unwrapped (Clown f a b)) Source #
Wrapped (Flip p a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Flip p a b) Source # Methods _Wrapped' :: Iso' (Flip p a b) (Unwrapped (Flip p a b)) Source #
Wrapped (Joker g a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Joker g a b) Source # Methods _Wrapped' :: Iso' (Joker g a b) (Unwrapped (Joker g a b)) Source #
Wrapped (WrappedBifunctor p a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedBifunctor p a b) Source # Methods _Wrapped' :: Iso' (WrappedBifunctor p a b) (Unwrapped (WrappedBifunctor p a b)) Source #
Wrapped (WrappedArrow p a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedArrow p a b) Source # Methods _Wrapped' :: Iso' (WrappedArrow p a b) (Unwrapped (WrappedArrow p a b)) Source #
Wrapped (Semi m a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Semi m a b) Source # Methods _Wrapped' :: Iso' (Semi m a b) (Unwrapped (Semi m a b)) Source #
Wrapped (WrappedCategory k3 a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (WrappedCategory k3 a b) Source # Methods _Wrapped' :: Iso' (WrappedCategory k3 a b) (Unwrapped (WrappedCategory k3 a b)) Source #
Wrapped (Dual k3 a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Dual k3 a b) Source # Methods _Wrapped' :: Iso' (Dual k3 a b) (Unwrapped (Dual k3 a b)) Source #
Wrapped (RWST r w s m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (RWST r w s m a) Source # Methods _Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) Source #
Wrapped (RWST r w s m a) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (RWST r w s m a) Source # Methods _Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) Source #
Wrapped (Tannen f p a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Tannen f p a b) Source # Methods _Wrapped' :: Iso' (Tannen f p a b) (Unwrapped (Tannen f p a b)) Source #
Wrapped (Cayley f p a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Cayley f p a b) Source # Methods _Wrapped' :: Iso' (Cayley f p a b) (Unwrapped (Cayley f p a b)) Source #
Wrapped (Biff p f g a b) |
Instance details Defined in Control.Lens.Wrapped Associated Types type Unwrapped (Biff p f g a b) Source # Methods _Wrapped' :: Iso' (Biff p f g a b) (Unwrapped (Biff p f g a b)) Source #

class (FunctorWithIndex i t, FoldableWithIndex i t, Traversable t) => TraversableWithIndex i (t :: Type -> Type) | t -> i where #

Minimal complete definition

Nothing

Methods

itraverse :: Applicative f => (i -> a -> f b) -> t a -> f (t b) #

#### Instances

Instances details

TraversableWithIndex () Identity |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (() -> a -> f b) -> Identity a -> f (Identity b) #
TraversableWithIndex () Par1 |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (() -> a -> f b) -> Par1 a -> f (Par1 b) #
TraversableWithIndex () Maybe |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (() -> a -> f b) -> Maybe a -> f (Maybe b) #
TraversableWithIndex Int ZipList |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Int -> a -> f b) -> ZipList a -> f (ZipList b) #
TraversableWithIndex Int IntMap |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Int -> a -> f b) -> IntMap a -> f (IntMap b) #
TraversableWithIndex Int Seq |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Int -> a -> f b) -> Seq a -> f (Seq b) #
TraversableWithIndex Int NonEmpty |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Int -> a -> f b) -> NonEmpty a -> f (NonEmpty b) #
TraversableWithIndex Int [] |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Int -> a -> f b) -> [a] -> f [b] #
TraversableWithIndex Void (Proxy :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> Proxy a -> f (Proxy b) #
TraversableWithIndex Void (U1 :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> U1 a -> f (U1 b) #
TraversableWithIndex Void (V1 :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> V1 a -> f (V1 b) #
Ix i => TraversableWithIndex i (Array i) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (i -> a -> f b) -> Array i a -> f (Array i b) #
TraversableWithIndex i (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods itraverse :: Applicative f => (i -> a -> f b) -> Level i a -> f (Level i b) #
TraversableWithIndex k (Map k) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (k -> a -> f b) -> Map k a -> f (Map k b) #
TraversableWithIndex k ((,) k) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (k -> a -> f b) -> (k, a) -> f (k, b) #
TraversableWithIndex Void (Const e :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> Const e a -> f (Const e b) #
TraversableWithIndex Void (Constant e :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> Constant e a -> f (Constant e b) #
TraversableWithIndex Int (V n) |
Instance details Defined in Linear.V Methods itraverse :: Applicative f => (Int -> a -> f b) -> V n a -> f (V n b) #
TraversableWithIndex i f => TraversableWithIndex i (Rec1 f) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (i -> a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #
TraversableWithIndex i f => TraversableWithIndex i (Backwards f) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (i -> a -> f0 b) -> Backwards f a -> f0 (Backwards f b) #
TraversableWithIndex i m => TraversableWithIndex i (IdentityT m) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (i -> a -> f b) -> IdentityT m a -> f (IdentityT m b) #
TraversableWithIndex i f => TraversableWithIndex i (Reverse f) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (i -> a -> f0 b) -> Reverse f a -> f0 (Reverse f b) #
TraversableWithIndex Void (K1 i c :: Type -> Type) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => (Void -> a -> f b) -> K1 i c a -> f (K1 i c b) #
TraversableWithIndex i (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods itraverse :: Applicative f => (i -> a -> f b0) -> Magma i t b a -> f (Magma i t b b0) #
TraversableWithIndex (E Plucker) Plucker |
Instance details Defined in Linear.Plucker Methods itraverse :: Applicative f => (E Plucker -> a -> f b) -> Plucker a -> f (Plucker b) #
TraversableWithIndex (E Quaternion) Quaternion |
Instance details Defined in Linear.Quaternion Methods itraverse :: Applicative f => (E Quaternion -> a -> f b) -> Quaternion a -> f (Quaternion b) #
TraversableWithIndex (E V0) V0 |
Instance details Defined in Linear.V0 Methods itraverse :: Applicative f => (E V0 -> a -> f b) -> V0 a -> f (V0 b) #
TraversableWithIndex (E V1) V1 |
Instance details Defined in Linear.V1 Methods itraverse :: Applicative f => (E V1 -> a -> f b) -> V1 a -> f (V1 b) #
TraversableWithIndex (E V2) V2 |
Instance details Defined in Linear.V2 Methods itraverse :: Applicative f => (E V2 -> a -> f b) -> V2 a -> f (V2 b) #
TraversableWithIndex (E V3) V3 |
Instance details Defined in Linear.V3 Methods itraverse :: Applicative f => (E V3 -> a -> f b) -> V3 a -> f (V3 b) #
TraversableWithIndex (E V4) V4 |
Instance details Defined in Linear.V4 Methods itraverse :: Applicative f => (E V4 -> a -> f b) -> V4 a -> f (V4 b) #
TraversableWithIndex [Int] Tree |
Instance details Defined in WithIndex Methods itraverse :: Applicative f => ([Int] -> a -> f b) -> Tree a -> f (Tree b) #
TraversableWithIndex i f => TraversableWithIndex [i] (Cofree f) |
Instance details Defined in Control.Comonad.Cofree Methods itraverse :: Applicative f0 => ([i] -> a -> f0 b) -> Cofree f a -> f0 (Cofree f b) #
TraversableWithIndex i f => TraversableWithIndex [i] (Free f) |
Instance details Defined in Control.Monad.Free Methods itraverse :: Applicative f0 => ([i] -> a -> f0 b) -> Free f a -> f0 (Free f b) #
(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (Product f g) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> Product f g a -> f0 (Product f g b) #
(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (Sum f g) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> Sum f g a -> f0 (Sum f g b) #
(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (f :*: g) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #
(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (f :+: g) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #
(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (i, j) (Compose f g) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => ((i, j) -> a -> f0 b) -> Compose f g a -> f0 (Compose f g b) #
(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (i, j) (f :.: g) |
Instance details Defined in WithIndex Methods itraverse :: Applicative f0 => ((i, j) -> a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #

class Foldable f => FoldableWithIndex i (f :: Type -> Type) | f -> i where #

Minimal complete definition

Nothing

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> f a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> f a -> m #

ifoldr :: (i -> a -> b -> b) -> b -> f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> f a -> b #

#### Instances

Instances details

FoldableWithIndex () Identity |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (() -> a -> m) -> Identity a -> m # ifoldMap' :: Monoid m => (() -> a -> m) -> Identity a -> m # ifoldr :: (() -> a -> b -> b) -> b -> Identity a -> b # ifoldl :: (() -> b -> a -> b) -> b -> Identity a -> b # ifoldr' :: (() -> a -> b -> b) -> b -> Identity a -> b # ifoldl' :: (() -> b -> a -> b) -> b -> Identity a -> b #
FoldableWithIndex () Par1 |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (() -> a -> m) -> Par1 a -> m # ifoldMap' :: Monoid m => (() -> a -> m) -> Par1 a -> m # ifoldr :: (() -> a -> b -> b) -> b -> Par1 a -> b # ifoldl :: (() -> b -> a -> b) -> b -> Par1 a -> b # ifoldr' :: (() -> a -> b -> b) -> b -> Par1 a -> b # ifoldl' :: (() -> b -> a -> b) -> b -> Par1 a -> b #
FoldableWithIndex () Maybe |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (() -> a -> m) -> Maybe a -> m # ifoldMap' :: Monoid m => (() -> a -> m) -> Maybe a -> m # ifoldr :: (() -> a -> b -> b) -> b -> Maybe a -> b # ifoldl :: (() -> b -> a -> b) -> b -> Maybe a -> b # ifoldr' :: (() -> a -> b -> b) -> b -> Maybe a -> b # ifoldl' :: (() -> b -> a -> b) -> b -> Maybe a -> b #
FoldableWithIndex Int ZipList |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Int -> a -> m) -> ZipList a -> m # ifoldMap' :: Monoid m => (Int -> a -> m) -> ZipList a -> m # ifoldr :: (Int -> a -> b -> b) -> b -> ZipList a -> b # ifoldl :: (Int -> b -> a -> b) -> b -> ZipList a -> b # ifoldr' :: (Int -> a -> b -> b) -> b -> ZipList a -> b # ifoldl' :: (Int -> b -> a -> b) -> b -> ZipList a -> b #
FoldableWithIndex Int IntMap |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Int -> a -> m) -> IntMap a -> m # ifoldMap' :: Monoid m => (Int -> a -> m) -> IntMap a -> m # ifoldr :: (Int -> a -> b -> b) -> b -> IntMap a -> b # ifoldl :: (Int -> b -> a -> b) -> b -> IntMap a -> b # ifoldr' :: (Int -> a -> b -> b) -> b -> IntMap a -> b # ifoldl' :: (Int -> b -> a -> b) -> b -> IntMap a -> b #
FoldableWithIndex Int Seq |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Int -> a -> m) -> Seq a -> m # ifoldMap' :: Monoid m => (Int -> a -> m) -> Seq a -> m # ifoldr :: (Int -> a -> b -> b) -> b -> Seq a -> b # ifoldl :: (Int -> b -> a -> b) -> b -> Seq a -> b # ifoldr' :: (Int -> a -> b -> b) -> b -> Seq a -> b # ifoldl' :: (Int -> b -> a -> b) -> b -> Seq a -> b #
FoldableWithIndex Int NonEmpty |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Int -> a -> m) -> NonEmpty a -> m # ifoldMap' :: Monoid m => (Int -> a -> m) -> NonEmpty a -> m # ifoldr :: (Int -> a -> b -> b) -> b -> NonEmpty a -> b # ifoldl :: (Int -> b -> a -> b) -> b -> NonEmpty a -> b # ifoldr' :: (Int -> a -> b -> b) -> b -> NonEmpty a -> b # ifoldl' :: (Int -> b -> a -> b) -> b -> NonEmpty a -> b #
FoldableWithIndex Int [] |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Int -> a -> m) -> [a] -> m # ifoldMap' :: Monoid m => (Int -> a -> m) -> [a] -> m # ifoldr :: (Int -> a -> b -> b) -> b -> [a] -> b # ifoldl :: (Int -> b -> a -> b) -> b -> [a] -> b # ifoldr' :: (Int -> a -> b -> b) -> b -> [a] -> b # ifoldl' :: (Int -> b -> a -> b) -> b -> [a] -> b #
FoldableWithIndex Void (Proxy :: Type -> Type) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Void -> a -> m) -> Proxy a -> m # ifoldMap' :: Monoid m => (Void -> a -> m) -> Proxy a -> m # ifoldr :: (Void -> a -> b -> b) -> b -> Proxy a -> b # ifoldl :: (Void -> b -> a -> b) -> b -> Proxy a -> b # ifoldr' :: (Void -> a -> b -> b) -> b -> Proxy a -> b # ifoldl' :: (Void -> b -> a -> b) -> b -> Proxy a -> b #
FoldableWithIndex Void (U1 :: Type -> Type) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Void -> a -> m) -> U1 a -> m # ifoldMap' :: Monoid m => (Void -> a -> m) -> U1 a -> m # ifoldr :: (Void -> a -> b -> b) -> b -> U1 a -> b # ifoldl :: (Void -> b -> a -> b) -> b -> U1 a -> b # ifoldr' :: (Void -> a -> b -> b) -> b -> U1 a -> b # ifoldl' :: (Void -> b -> a -> b) -> b -> U1 a -> b #
FoldableWithIndex Void (V1 :: Type -> Type) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Void -> a -> m) -> V1 a -> m # ifoldMap' :: Monoid m => (Void -> a -> m) -> V1 a -> m # ifoldr :: (Void -> a -> b -> b) -> b -> V1 a -> b # ifoldl :: (Void -> b -> a -> b) -> b -> V1 a -> b # ifoldr' :: (Void -> a -> b -> b) -> b -> V1 a -> b # ifoldl' :: (Void -> b -> a -> b) -> b -> V1 a -> b #
Ix i => FoldableWithIndex i (Array i) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (i -> a -> m) -> Array i a -> m # ifoldMap' :: Monoid m => (i -> a -> m) -> Array i a -> m # ifoldr :: (i -> a -> b -> b) -> b -> Array i a -> b # ifoldl :: (i -> b -> a -> b) -> b -> Array i a -> b # ifoldr' :: (i -> a -> b -> b) -> b -> Array i a -> b # ifoldl' :: (i -> b -> a -> b) -> b -> Array i a -> b #
FoldableWithIndex i (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods ifoldMap :: Monoid m => (i -> a -> m) -> Level i a -> m # ifoldMap' :: Monoid m => (i -> a -> m) -> Level i a -> m # ifoldr :: (i -> a -> b -> b) -> b -> Level i a -> b # ifoldl :: (i -> b -> a -> b) -> b -> Level i a -> b # ifoldr' :: (i -> a -> b -> b) -> b -> Level i a -> b # ifoldl' :: (i -> b -> a -> b) -> b -> Level i a -> b #
FoldableWithIndex k (Map k) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (k -> a -> m) -> Map k a -> m # ifoldMap' :: Monoid m => (k -> a -> m) -> Map k a -> m # ifoldr :: (k -> a -> b -> b) -> b -> Map k a -> b # ifoldl :: (k -> b -> a -> b) -> b -> Map k a -> b # ifoldr' :: (k -> a -> b -> b) -> b -> Map k a -> b # ifoldl' :: (k -> b -> a -> b) -> b -> Map k a -> b #
FoldableWithIndex k ((,) k) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (k -> a -> m) -> (k, a) -> m # ifoldMap' :: Monoid m => (k -> a -> m) -> (k, a) -> m # ifoldr :: (k -> a -> b -> b) -> b -> (k, a) -> b # ifoldl :: (k -> b -> a -> b) -> b -> (k, a) -> b # ifoldr' :: (k -> a -> b -> b) -> b -> (k, a) -> b # ifoldl' :: (k -> b -> a -> b) -> b -> (k, a) -> b #
FoldableWithIndex Void (Const e :: Type -> Type) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Void -> a -> m) -> Const e a -> m # ifoldMap' :: Monoid m => (Void -> a -> m) -> Const e a -> m # ifoldr :: (Void -> a -> b -> b) -> b -> Const e a -> b # ifoldl :: (Void -> b -> a -> b) -> b -> Const e a -> b # ifoldr' :: (Void -> a -> b -> b) -> b -> Const e a -> b # ifoldl' :: (Void -> b -> a -> b) -> b -> Const e a -> b #
FoldableWithIndex Void (Constant e :: Type -> Type) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Constant e a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> Constant e a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> Constant e a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> Constant e a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> Constant e a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> Constant e a -> b #

FoldableWithIndex Int (V n) |
Instance details Defined in Linear.V Methods ifoldMap :: Monoid m => (Int -> a -> m) -> V n a -> m # ifoldMap' :: Monoid m => (Int -> a -> m) -> V n a -> m # ifoldr :: (Int -> a -> b -> b) -> b -> V n a -> b # ifoldl :: (Int -> b -> a -> b) -> b -> V n a -> b # ifoldr' :: (Int -> a -> b -> b) -> b -> V n a -> b # ifoldl' :: (Int -> b -> a -> b) -> b -> V n a -> b #
FoldableWithIndex i f => FoldableWithIndex i (Rec1 f) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (i -> a -> m) -> Rec1 f a -> m # ifoldMap' :: Monoid m => (i -> a -> m) -> Rec1 f a -> m # ifoldr :: (i -> a -> b -> b) -> b -> Rec1 f a -> b # ifoldl :: (i -> b -> a -> b) -> b -> Rec1 f a -> b # ifoldr' :: (i -> a -> b -> b) -> b -> Rec1 f a -> b # ifoldl' :: (i -> b -> a -> b) -> b -> Rec1 f a -> b #
FoldableWithIndex i f => FoldableWithIndex i (Backwards f) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Backwards f a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Backwards f a -> m #

ifoldr :: (i -> a -> b -> b) -> b -> Backwards f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Backwards f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Backwards f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Backwards f a -> b #

FoldableWithIndex i m => FoldableWithIndex i (IdentityT m) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m0 => (i -> a -> m0) -> IdentityT m a -> m0 #

ifoldMap' :: Monoid m0 => (i -> a -> m0) -> IdentityT m a -> m0 #

ifoldr :: (i -> a -> b -> b) -> b -> IdentityT m a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> IdentityT m a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> IdentityT m a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> IdentityT m a -> b #

FoldableWithIndex i f => FoldableWithIndex i (Reverse f) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (i -> a -> m) -> Reverse f a -> m # ifoldMap' :: Monoid m => (i -> a -> m) -> Reverse f a -> m # ifoldr :: (i -> a -> b -> b) -> b -> Reverse f a -> b # ifoldl :: (i -> b -> a -> b) -> b -> Reverse f a -> b # ifoldr' :: (i -> a -> b -> b) -> b -> Reverse f a -> b # ifoldl' :: (i -> b -> a -> b) -> b -> Reverse f a -> b #
FoldableWithIndex Void (K1 i c :: Type -> Type) |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => (Void -> a -> m) -> K1 i c a -> m # ifoldMap' :: Monoid m => (Void -> a -> m) -> K1 i c a -> m # ifoldr :: (Void -> a -> b -> b) -> b -> K1 i c a -> b # ifoldl :: (Void -> b -> a -> b) -> b -> K1 i c a -> b # ifoldr' :: (Void -> a -> b -> b) -> b -> K1 i c a -> b # ifoldl' :: (Void -> b -> a -> b) -> b -> K1 i c a -> b #
FoldableWithIndex i (Magma i t b) |

Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifoldr :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldr' :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl' :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

FoldableWithIndex (E Plucker) Plucker |

Instance details

Defined in Linear.Plucker

Methods

ifoldMap :: Monoid m => (E Plucker -> a -> m) -> Plucker a -> m #

ifoldMap' :: Monoid m => (E Plucker -> a -> m) -> Plucker a -> m #

ifoldr :: (E Plucker -> a -> b -> b) -> b -> Plucker a -> b #

ifoldl :: (E Plucker -> b -> a -> b) -> b -> Plucker a -> b #

ifoldr' :: (E Plucker -> a -> b -> b) -> b -> Plucker a -> b #

ifoldl' :: (E Plucker -> b -> a -> b) -> b -> Plucker a -> b #

FoldableWithIndex (E Quaternion) Quaternion |

Instance details

Defined in Linear.Quaternion

Methods

ifoldMap :: Monoid m => (E Quaternion -> a -> m) -> Quaternion a -> m #

ifoldMap' :: Monoid m => (E Quaternion -> a -> m) -> Quaternion a -> m #

ifoldr :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b #

ifoldl :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b #

ifoldr' :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b #

ifoldl' :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b #

FoldableWithIndex (E V0) V0 |
Instance details Defined in Linear.V0 Methods ifoldMap :: Monoid m => (E V0 -> a -> m) -> V0 a -> m # ifoldMap' :: Monoid m => (E V0 -> a -> m) -> V0 a -> m # ifoldr :: (E V0 -> a -> b -> b) -> b -> V0 a -> b # ifoldl :: (E V0 -> b -> a -> b) -> b -> V0 a -> b # ifoldr' :: (E V0 -> a -> b -> b) -> b -> V0 a -> b # ifoldl' :: (E V0 -> b -> a -> b) -> b -> V0 a -> b #
FoldableWithIndex (E V1) V1 |
Instance details Defined in Linear.V1 Methods ifoldMap :: Monoid m => (E V1 -> a -> m) -> V1 a -> m # ifoldMap' :: Monoid m => (E V1 -> a -> m) -> V1 a -> m # ifoldr :: (E V1 -> a -> b -> b) -> b -> V1 a -> b # ifoldl :: (E V1 -> b -> a -> b) -> b -> V1 a -> b # ifoldr' :: (E V1 -> a -> b -> b) -> b -> V1 a -> b # ifoldl' :: (E V1 -> b -> a -> b) -> b -> V1 a -> b #
FoldableWithIndex (E V2) V2 |
Instance details Defined in Linear.V2 Methods ifoldMap :: Monoid m => (E V2 -> a -> m) -> V2 a -> m # ifoldMap' :: Monoid m => (E V2 -> a -> m) -> V2 a -> m # ifoldr :: (E V2 -> a -> b -> b) -> b -> V2 a -> b # ifoldl :: (E V2 -> b -> a -> b) -> b -> V2 a -> b # ifoldr' :: (E V2 -> a -> b -> b) -> b -> V2 a -> b # ifoldl' :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #
FoldableWithIndex (E V3) V3 |
Instance details Defined in Linear.V3 Methods ifoldMap :: Monoid m => (E V3 -> a -> m) -> V3 a -> m # ifoldMap' :: Monoid m => (E V3 -> a -> m) -> V3 a -> m # ifoldr :: (E V3 -> a -> b -> b) -> b -> V3 a -> b # ifoldl :: (E V3 -> b -> a -> b) -> b -> V3 a -> b # ifoldr' :: (E V3 -> a -> b -> b) -> b -> V3 a -> b # ifoldl' :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #
FoldableWithIndex (E V4) V4 |
Instance details Defined in Linear.V4 Methods ifoldMap :: Monoid m => (E V4 -> a -> m) -> V4 a -> m # ifoldMap' :: Monoid m => (E V4 -> a -> m) -> V4 a -> m # ifoldr :: (E V4 -> a -> b -> b) -> b -> V4 a -> b # ifoldl :: (E V4 -> b -> a -> b) -> b -> V4 a -> b # ifoldr' :: (E V4 -> a -> b -> b) -> b -> V4 a -> b # ifoldl' :: (E V4 -> b -> a -> b) -> b -> V4 a -> b #
FoldableWithIndex [Int] Tree |
Instance details Defined in WithIndex Methods ifoldMap :: Monoid m => ([Int] -> a -> m) -> Tree a -> m # ifoldMap' :: Monoid m => ([Int] -> a -> m) -> Tree a -> m # ifoldr :: ([Int] -> a -> b -> b) -> b -> Tree a -> b # ifoldl :: ([Int] -> b -> a -> b) -> b -> Tree a -> b # ifoldr' :: ([Int] -> a -> b -> b) -> b -> Tree a -> b # ifoldl' :: ([Int] -> b -> a -> b) -> b -> Tree a -> b #
FoldableWithIndex i f => FoldableWithIndex [i] (Cofree f) |

Instance details

Defined in Control.Comonad.Cofree

Methods

ifoldMap :: Monoid m => ([i] -> a -> m) -> Cofree f a -> m #

ifoldMap' :: Monoid m => ([i] -> a -> m) -> Cofree f a -> m #

ifoldr :: ([i] -> a -> b -> b) -> b -> Cofree f a -> b #

ifoldl :: ([i] -> b -> a -> b) -> b -> Cofree f a -> b #

ifoldr' :: ([i] -> a -> b -> b) -> b -> Cofree f a -> b #

ifoldl' :: ([i] -> b -> a -> b) -> b -> Cofree f a -> b #

FoldableWithIndex i f => FoldableWithIndex [i] (Free f) |
Instance details Defined in Control.Monad.Free Methods ifoldMap :: Monoid m => ([i] -> a -> m) -> Free f a -> m # ifoldMap' :: Monoid m => ([i] -> a -> m) -> Free f a -> m # ifoldr :: ([i] -> a -> b -> b) -> b -> Free f a -> b # ifoldl :: ([i] -> b -> a -> b) -> b -> Free f a -> b # ifoldr' :: ([i] -> a -> b -> b) -> b -> Free f a -> b # ifoldl' :: ([i] -> b -> a -> b) -> b -> Free f a -> b #
(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (Product f g) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> Product f g a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> Product f g a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> Product f g a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> Product f g a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> Product f g a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> Product f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (Sum f g) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> Sum f g a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> Sum f g a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> Sum f g a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> Sum f g a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> Sum f g a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> Sum f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (f :*: g) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> (f :*: g) a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> (f :*: g) a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> (f :*: g) a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> (f :*: g) a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> (f :*: g) a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> (f :*: g) a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (f :+: g) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> (f :+: g) a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> (f :+: g) a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> (f :+: g) a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> (f :+: g) a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> (f :+: g) a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> (f :+: g) a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (i, j) (Compose f g) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => ((i, j) -> a -> m) -> Compose f g a -> m #

ifoldMap' :: Monoid m => ((i, j) -> a -> m) -> Compose f g a -> m #

ifoldr :: ((i, j) -> a -> b -> b) -> b -> Compose f g a -> b #

ifoldl :: ((i, j) -> b -> a -> b) -> b -> Compose f g a -> b #

ifoldr' :: ((i, j) -> a -> b -> b) -> b -> Compose f g a -> b #

ifoldl' :: ((i, j) -> b -> a -> b) -> b -> Compose f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (i, j) (f :.: g) |

Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => ((i, j) -> a -> m) -> (f :.: g) a -> m #

ifoldMap' :: Monoid m => ((i, j) -> a -> m) -> (f :.: g) a -> m #

ifoldr :: ((i, j) -> a -> b -> b) -> b -> (f :.: g) a -> b #

ifoldl :: ((i, j) -> b -> a -> b) -> b -> (f :.: g) a -> b #

ifoldr' :: ((i, j) -> a -> b -> b) -> b -> (f :.: g) a -> b #

ifoldl' :: ((i, j) -> b -> a -> b) -> b -> (f :.: g) a -> b #

class Functor f => FunctorWithIndex i (f :: Type -> Type) | f -> i where #

Minimal complete definition

Nothing

Methods

imap :: (i -> a -> b) -> f a -> f b #

#### Instances

Instances details

FunctorWithIndex () Identity |
Instance details Defined in WithIndex Methods imap :: (() -> a -> b) -> Identity a -> Identity b #
FunctorWithIndex () Par1 |
Instance details Defined in WithIndex Methods imap :: (() -> a -> b) -> Par1 a -> Par1 b #
FunctorWithIndex () Maybe |
Instance details Defined in WithIndex Methods imap :: (() -> a -> b) -> Maybe a -> Maybe b #
FunctorWithIndex Int ZipList |
Instance details Defined in WithIndex Methods imap :: (Int -> a -> b) -> ZipList a -> ZipList b #
FunctorWithIndex Int IntMap |
Instance details Defined in WithIndex Methods imap :: (Int -> a -> b) -> IntMap a -> IntMap b #
FunctorWithIndex Int Seq |
Instance details Defined in WithIndex Methods imap :: (Int -> a -> b) -> Seq a -> Seq b #
FunctorWithIndex Int NonEmpty |
Instance details Defined in WithIndex Methods imap :: (Int -> a -> b) -> NonEmpty a -> NonEmpty b #
FunctorWithIndex Int [] |
Instance details Defined in WithIndex Methods imap :: (Int -> a -> b) -> [a] -> [b] #
FunctorWithIndex Void (Proxy :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> Proxy a -> Proxy b #
FunctorWithIndex Void (U1 :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> U1 a -> U1 b #
FunctorWithIndex Void (V1 :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> V1 a -> V1 b #
Ix i => FunctorWithIndex i (Array i) |
Instance details Defined in WithIndex Methods imap :: (i -> a -> b) -> Array i a -> Array i b #
FunctorWithIndex i (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods imap :: (i -> a -> b) -> Level i a -> Level i b #
FunctorWithIndex k (Map k) |
Instance details Defined in WithIndex Methods imap :: (k -> a -> b) -> Map k a -> Map k b #
FunctorWithIndex k ((,) k) |
Instance details Defined in WithIndex Methods imap :: (k -> a -> b) -> (k, a) -> (k, b) #
FunctorWithIndex Void (Const e :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> Const e a -> Const e b #
FunctorWithIndex Void (Constant e :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> Constant e a -> Constant e b #
FunctorWithIndex Int (V n) |
Instance details Defined in Linear.V Methods imap :: (Int -> a -> b) -> V n a -> V n b #
FunctorWithIndex i f => FunctorWithIndex i (Rec1 f) |
Instance details Defined in WithIndex Methods imap :: (i -> a -> b) -> Rec1 f a -> Rec1 f b #
FunctorWithIndex i f => FunctorWithIndex i (Backwards f) |
Instance details Defined in WithIndex Methods imap :: (i -> a -> b) -> Backwards f a -> Backwards f b #
FunctorWithIndex i m => FunctorWithIndex i (IdentityT m) |
Instance details Defined in WithIndex Methods imap :: (i -> a -> b) -> IdentityT m a -> IdentityT m b #
FunctorWithIndex i f => FunctorWithIndex i (Reverse f) |
Instance details Defined in WithIndex Methods imap :: (i -> a -> b) -> Reverse f a -> Reverse f b #
FunctorWithIndex Void (K1 i c :: Type -> Type) |
Instance details Defined in WithIndex Methods imap :: (Void -> a -> b) -> K1 i c a -> K1 i c b #
FunctorWithIndex i (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods imap :: (i -> a -> b0) -> Magma i t b a -> Magma i t b b0 #
FunctorWithIndex r ((->) r) |
Instance details Defined in WithIndex Methods imap :: (r -> a -> b) -> (r -> a) -> r -> b #
FunctorWithIndex (E Plucker) Plucker |
Instance details Defined in Linear.Plucker Methods imap :: (E Plucker -> a -> b) -> Plucker a -> Plucker b #
FunctorWithIndex (E Quaternion) Quaternion |
Instance details Defined in Linear.Quaternion Methods imap :: (E Quaternion -> a -> b) -> Quaternion a -> Quaternion b #
FunctorWithIndex (E V0) V0 |
Instance details Defined in Linear.V0 Methods imap :: (E V0 -> a -> b) -> V0 a -> V0 b #
FunctorWithIndex (E V1) V1 |
Instance details Defined in Linear.V1 Methods imap :: (E V1 -> a -> b) -> V1 a -> V1 b #
FunctorWithIndex (E V2) V2 |
Instance details Defined in Linear.V2 Methods imap :: (E V2 -> a -> b) -> V2 a -> V2 b #
FunctorWithIndex (E V3) V3 |
Instance details Defined in Linear.V3 Methods imap :: (E V3 -> a -> b) -> V3 a -> V3 b #
FunctorWithIndex (E V4) V4 |
Instance details Defined in Linear.V4 Methods imap :: (E V4 -> a -> b) -> V4 a -> V4 b #
FunctorWithIndex [Int] Tree |
Instance details Defined in WithIndex Methods imap :: ([Int] -> a -> b) -> Tree a -> Tree b #
FunctorWithIndex i f => FunctorWithIndex [i] (Cofree f) |
Instance details Defined in Control.Comonad.Cofree Methods imap :: ([i] -> a -> b) -> Cofree f a -> Cofree f b #
FunctorWithIndex i f => FunctorWithIndex [i] (Free f) |
Instance details Defined in Control.Monad.Free Methods imap :: ([i] -> a -> b) -> Free f a -> Free f b #
FunctorWithIndex i m => FunctorWithIndex (e, i) (ReaderT e m) |
Instance details Defined in WithIndex Methods imap :: ((e, i) -> a -> b) -> ReaderT e m a -> ReaderT e m b #
(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Product f g) |
Instance details Defined in WithIndex Methods imap :: (Either i j -> a -> b) -> Product f g a -> Product f g b #
(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Sum f g) |
Instance details Defined in WithIndex Methods imap :: (Either i j -> a -> b) -> Sum f g a -> Sum f g b #
(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :*: g) |
Instance details Defined in WithIndex Methods imap :: (Either i j -> a -> b) -> (f :*: g) a -> (f :*: g) b #
(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :+: g) |
Instance details Defined in WithIndex Methods imap :: (Either i j -> a -> b) -> (f :+: g) a -> (f :+: g) b #
(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (Compose f g) |
Instance details Defined in WithIndex Methods imap :: ((i, j) -> a -> b) -> Compose f g a -> Compose f g b #
(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (f :.: g) |
Instance details Defined in WithIndex Methods imap :: ((i, j) -> a -> b) -> (f :.: g) a -> (f :.: g) b #

class Profunctor (p :: Type -> Type -> Type) where Source #

Formally, the class `Profunctor` represents a profunctor from `Hask` -> `Hask`.

Intuitively it is a bifunctor where the first argument is contravariant and the second argument is covariant.

You can define a `Profunctor` by either defining `dimap` or by defining both `lmap` and `rmap`.

If you supply `dimap`, you should ensure that:

    dimap id id ≡ id

If you supply `lmap` and `rmap`, ensure:

    lmap id ≡ id
    rmap id ≡ id

If you supply both, you should also ensure:

    dimap f g ≡ lmap f . rmap g

These ensure by parametricity:

    dimap (f . g) (h . i) ≡ dimap g h . dimap f i
    lmap (f . g) ≡ lmap g . lmap f
    rmap (f . g) ≡ rmap f . rmap g

Minimal complete definition

dimap | lmap, rmap

Methods

dimap :: (a -> b) -> (c -> d) -> p b c -> p a d Source #

Map over both arguments at the same time.

    dimap f g ≡ lmap f . rmap g

lmap :: (a -> b) -> p b c -> p a c Source #

Map the first argument contravariantly.

    lmap f ≡ dimap f id

rmap :: (b -> c) -> p a b -> p a c Source #

Map the second argument covariantly.

    rmap ≡ dimap id

#### Instances

Instances details

Profunctor Measured |

Instance details

Defined in Diagrams.Core.Measure

Methods

dimap :: (a -> b) -> (c -> d) -> Measured b c -> Measured a d Source #

lmap :: (a -> b) -> Measured b c -> Measured a c Source #

rmap :: (b -> c) -> Measured a b -> Measured a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Measured a b -> Measured a c Source #

(.#) :: forall a b c q. Coercible b a => Measured b c -> q a b -> Measured a c Source #

Profunctor ReifiedFold |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d Source #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c Source #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedFold a b -> ReifiedFold a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedFold b c -> q a b -> ReifiedFold a c Source #

Profunctor ReifiedGetter |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d Source #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c Source #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedGetter a b -> ReifiedGetter a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedGetter b c -> q a b -> ReifiedGetter a c Source #

Monad m => Profunctor (Kleisli m) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d Source #

lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c Source #

rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Kleisli m a b -> Kleisli m a c Source #

(.#) :: forall a b c q. Coercible b a => Kleisli m b c -> q a b -> Kleisli m a c Source #

Functor v => Profunctor (Query v) |

Instance details

Defined in Diagrams.Core.Query

Methods

dimap :: (a -> b) -> (c -> d) -> Query v b c -> Query v a d Source #

lmap :: (a -> b) -> Query v b c -> Query v a c Source #

rmap :: (b -> c) -> Query v a b -> Query v a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Query v a b -> Query v a c Source #

(.#) :: forall a b c q. Coercible b a => Query v b c -> q a b -> Query v a c Source #

Profunctor (Indexed i) |

Instance details

Defined in Control.Lens.Internal.Indexed

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d Source #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c Source #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Indexed i a b -> Indexed i a c Source #

(.#) :: forall a b c q. Coercible b a => Indexed i b c -> q a b -> Indexed i a c Source #

Profunctor (ReifiedIndexedFold i) |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d Source #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c Source #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedIndexedFold i b c -> q a b -> ReifiedIndexedFold i a c Source #

Profunctor (ReifiedIndexedGetter i) |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d Source #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c Source #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedIndexedGetter i b c -> q a b -> ReifiedIndexedGetter i a c Source #

Profunctor (CopastroSum p) |

Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> CopastroSum p b c -> CopastroSum p a d Source #

lmap :: (a -> b) -> CopastroSum p b c -> CopastroSum p a c Source #

rmap :: (b -> c) -> CopastroSum p a b -> CopastroSum p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> CopastroSum p a b -> CopastroSum p a c Source #

(.#) :: forall a b c q. Coercible b a => CopastroSum p b c -> q a b -> CopastroSum p a c Source #

Profunctor (CotambaraSum p) |

Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> CotambaraSum p b c -> CotambaraSum p a d Source #

lmap :: (a -> b) -> CotambaraSum p b c -> CotambaraSum p a c Source #

rmap :: (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> CotambaraSum p a b -> CotambaraSum p a c Source #

(.#) :: forall a b c q. Coercible b a => CotambaraSum p b c -> q a b -> CotambaraSum p a c Source #

Profunctor (PastroSum p) |

Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> PastroSum p b c -> PastroSum p a d Source #

lmap :: (a -> b) -> PastroSum p b c -> PastroSum p a c Source #

rmap :: (b -> c) -> PastroSum p a b -> PastroSum p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> PastroSum p a b -> PastroSum p a c Source #

(.#) :: forall a b c q. Coercible b a => PastroSum p b c -> q a b -> PastroSum p a c Source #

Profunctor p => Profunctor (TambaraSum p) |

Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> TambaraSum p b c -> TambaraSum p a d Source #

lmap :: (a -> b) -> TambaraSum p b c -> TambaraSum p a c Source #

rmap :: (b -> c) -> TambaraSum p a b -> TambaraSum p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> TambaraSum p a b -> TambaraSum p a c Source #

(.#) :: forall a b c q. Coercible b a => TambaraSum p b c -> q a b -> TambaraSum p a c Source #

Profunctor p => Profunctor (Closure p) |

Instance details

Defined in Data.Profunctor.Closed

Methods

dimap :: (a -> b) -> (c -> d) -> Closure p b c -> Closure p a d Source #

lmap :: (a -> b) -> Closure p b c -> Closure p a c Source #

rmap :: (b -> c) -> Closure p a b -> Closure p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Closure p a b -> Closure p a c Source #

(.#) :: forall a b c q. Coercible b a => Closure p b c -> q a b -> Closure p a c Source #

Profunctor (Environment p) |

Instance details

Defined in Data.Profunctor.Closed

Methods

dimap :: (a -> b) -> (c -> d) -> Environment p b c -> Environment p a d Source #

lmap :: (a -> b) -> Environment p b c -> Environment p a c Source #

rmap :: (b -> c) -> Environment p a b -> Environment p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Environment p a b -> Environment p a c Source #

(.#) :: forall a b c q. Coercible b a => Environment p b c -> q a b -> Environment p a c Source #

Profunctor (Copastro p) |

Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d Source #

lmap :: (a -> b) -> Copastro p b c -> Copastro p a c Source #

rmap :: (b -> c) -> Copastro p a b -> Copastro p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Copastro p a b -> Copastro p a c Source #

(.#) :: forall a b c q. Coercible b a => Copastro p b c -> q a b -> Copastro p a c Source #

Profunctor (Cotambara p) |

Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d Source #

lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c Source #

rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Cotambara p a b -> Cotambara p a c Source #

(.#) :: forall a b c q. Coercible b a => Cotambara p b c -> q a b -> Cotambara p a c Source #

Profunctor (Pastro p) |

Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d Source #

lmap :: (a -> b) -> Pastro p b c -> Pastro p a c Source #

rmap :: (b -> c) -> Pastro p a b -> Pastro p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Pastro p a b -> Pastro p a c Source #

(.#) :: forall a b c q. Coercible b a => Pastro p b c -> q a b -> Pastro p a c Source #

Profunctor p => Profunctor (Tambara p) |

Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d Source #

lmap :: (a -> b) -> Tambara p b c -> Tambara p a c Source #

rmap :: (b -> c) -> Tambara p a b -> Tambara p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Tambara p a b -> Tambara p a c Source #

(.#) :: forall a b c q. Coercible b a => Tambara p b c -> q a b -> Tambara p a c Source #

Profunctor (Tagged :: Type -> Type -> Type) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged b c -> Tagged a d Source #

lmap :: (a -> b) -> Tagged b c -> Tagged a c Source #

rmap :: (b -> c) -> Tagged a b -> Tagged a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Tagged a b -> Tagged a c Source #

(.#) :: forall a b c q. Coercible b a => Tagged b c -> q a b -> Tagged a c Source #

Functor w => Profunctor (Cokleisli w) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d Source #

lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c Source #

rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Cokleisli w a b -> Cokleisli w a c Source #

(.#) :: forall a b c q. Coercible b a => Cokleisli w b c -> q a b -> Cokleisli w a c Source #

Profunctor (Exchange a b) |

Instance details

Defined in Control.Lens.Internal.Iso

Methods

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

lmap :: (a0 -> b0) -> Exchange a b b0 c -> Exchange a b a0 c Source #

rmap :: (b0 -> c) -> Exchange a b a0 b0 -> Exchange a b a0 c Source #

(#.) :: forall a0 b0 c q. Coercible c b0 => q b0 c -> Exchange a b a0 b0 -> Exchange a b a0 c Source #

(.#) :: forall a0 b0 c q. Coercible b0 a0 => Exchange a b b0 c -> q a0 b0 -> Exchange a b a0 c Source #

Profunctor (Market a b) |

Instance details

Defined in Control.Lens.Internal.Prism

Methods

dimap :: (a0 -> b0) -> (c -> d) -> Market a b b0 c -> Market a b a0 d Source #

lmap :: (a0 -> b0) -> Market a b b0 c -> Market a b a0 c Source #

rmap :: (b0 -> c) -> Market a b a0 b0 -> Market a b a0 c Source #

(#.) :: forall a0 b0 c q. Coercible c b0 => q b0 c -> Market a b a0 b0 -> Market a b a0 c Source #

(.#) :: forall a0 b0 c q. Coercible b0 a0 => Market a b b0 c -> q a0 b0 -> Market a b a0 c Source #

Functor f => Profunctor (Costar f) |

Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d Source #

lmap :: (a -> b) -> Costar f b c -> Costar f a c Source #

rmap :: (b -> c) -> Costar f a b -> Costar f a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Costar f a b -> Costar f a c Source #

(.#) :: forall a b c q. Coercible b a => Costar f b c -> q a b -> Costar f a c Source #

Profunctor (Forget r :: Type -> Type -> Type) |

Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d Source #

lmap :: (a -> b) -> Forget r b c -> Forget r a c Source #

rmap :: (b -> c) -> Forget r a b -> Forget r a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Forget r a b -> Forget r a c Source #

(.#) :: forall a b c q. Coercible b a => Forget r b c -> q a b -> Forget r a c Source #

Functor f => Profunctor (Star f) |
Instance details Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d Source # lmap :: (a -> b) -> Star f b c -> Star f a c Source # rmap :: (b -> c) -> Star f a b -> Star f a c Source # (#.) :: forall a b c q. Coercible c b => q b c -> Star f a b -> Star f a c Source # (.#) :: forall a b c q. Coercible b a => Star f b c -> q a b -> Star f a c Source #
Profunctor (->) |
Instance details Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d Source # lmap :: (a -> b) -> (b -> c) -> a -> c Source # rmap :: (b -> c) -> (a -> b) -> a -> c Source # (#.) :: forall a b c q. Coercible c b => q b c -> (a -> b) -> a -> c Source # (.#) :: forall a b c q. Coercible b a => (b -> c) -> q a b -> a -> c Source #
Contravariant f => Profunctor (Clown f :: Type -> Type -> Type) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Clown f b c -> Clown f a d Source #

lmap :: (a -> b) -> Clown f b c -> Clown f a c Source #

rmap :: (b -> c) -> Clown f a b -> Clown f a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Clown f a b -> Clown f a c Source #

(.#) :: forall a b c q. Coercible b a => Clown f b c -> q a b -> Clown f a c Source #

Functor f => Profunctor (Joker f :: Type -> Type -> Type) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Joker f b c -> Joker f a d Source #

lmap :: (a -> b) -> Joker f b c -> Joker f a c Source #

rmap :: (b -> c) -> Joker f a b -> Joker f a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Joker f a b -> Joker f a c Source #

(.#) :: forall a b c q. Coercible b a => Joker f b c -> q a b -> Joker f a c Source #

Arrow p => Profunctor (WrappedArrow p) |

Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d Source #

lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c Source #

rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> WrappedArrow p a b -> WrappedArrow p a c Source #

(.#) :: forall a b c q. Coercible b a => WrappedArrow p b c -> q a b -> WrappedArrow p a c Source #

(Profunctor p, Profunctor q) => Profunctor (Product p q) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Product p q b c -> Product p q a d Source #

lmap :: (a -> b) -> Product p q b c -> Product p q a c Source #

rmap :: (b -> c) -> Product p q a b -> Product p q a c Source #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Product p q a b -> Product p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Product p q b c -> q0 a b -> Product p q a c Source #

(Profunctor p, Profunctor q) => Profunctor (Sum p q) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Sum p q b c -> Sum p q a d Source #

lmap :: (a -> b) -> Sum p q b c -> Sum p q a c Source #

rmap :: (b -> c) -> Sum p q a b -> Sum p q a c Source #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Sum p q a b -> Sum p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Sum p q b c -> q0 a b -> Sum p q a c Source #

(Functor f, Profunctor p) => Profunctor (Tannen f p) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Tannen f p b c -> Tannen f p a d Source #

lmap :: (a -> b) -> Tannen f p b c -> Tannen f p a c Source #

rmap :: (b -> c) -> Tannen f p a b -> Tannen f p a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Tannen f p a b -> Tannen f p a c Source #

(.#) :: forall a b c q. Coercible b a => Tannen f p b c -> q a b -> Tannen f p a c Source #

(Profunctor p, Profunctor q) => Profunctor (Procompose p q) |

Instance details

Defined in Data.Profunctor.Composition

Methods

dimap :: (a -> b) -> (c -> d) -> Procompose p q b c -> Procompose p q a d Source #

lmap :: (a -> b) -> Procompose p q b c -> Procompose p q a c Source #

rmap :: (b -> c) -> Procompose p q a b -> Procompose p q a c Source #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Procompose p q a b -> Procompose p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Procompose p q b c -> q0 a b -> Procompose p q a c Source #

(Profunctor p, Profunctor q) => Profunctor (Rift p q) |

Instance details

Defined in Data.Profunctor.Composition

Methods

dimap :: (a -> b) -> (c -> d) -> Rift p q b c -> Rift p q a d Source #

lmap :: (a -> b) -> Rift p q b c -> Rift p q a c Source #

rmap :: (b -> c) -> Rift p q a b -> Rift p q a c Source #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Rift p q a b -> Rift p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Rift p q b c -> q0 a b -> Rift p q a c Source #

(Profunctor p, Functor f, Functor g) => Profunctor (Biff p f g) |

Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Biff p f g b c -> Biff p f g a d Source #

lmap :: (a -> b) -> Biff p f g b c -> Biff p f g a c Source #

rmap :: (b -> c) -> Biff p f g a b -> Biff p f g a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Biff p f g a b -> Biff p f g a c Source #

(.#) :: forall a b c q. Coercible b a => Biff p f g b c -> q a b -> Biff p f g a c Source #

class Profunctor p => Choice (p :: Type -> Type -> Type) where Source #

The generalization of `Costar` of `Functor` that is strong with respect to `Either`.

Note: This is also a notion of strength, except with regards to another monoidal structure that we can choose to equip Hask with: the cocartesian coproduct.

Minimal complete definition

left' | right'

Methods

left' :: p a b -> p (Either a c) (Either b c) Source #

Laws:

    left' ≡ dimap swapE swapE . right' where
      swapE :: Either a b -> Either b a
      swapE = either Right Left
    rmap Left ≡ lmap Left . left'
    lmap (right f) . left' ≡ rmap (right f) . left'
    left' . left' ≡ dimap assocE unassocE . left' where
      assocE :: Either (Either a b) c -> Either a (Either b c)
      assocE (Left (Left a)) = Left a
      assocE (Left (Right b)) = Right (Left b)
      assocE (Right c) = Right (Right c)
      unassocE :: Either a (Either b c) -> Either (Either a b) c
      unassocE (Left a) = Left (Left a)
      unassocE (Right (Left b)) = Left (Right b)
      unassocE (Right (Right c)) = Right c

right' :: p a b -> p (Either c a) (Either c b) Source #

Laws:

    right' ≡ dimap swapE swapE . left' where
      swapE :: Either a b -> Either b a
      swapE = either Right Left
    rmap Right ≡ lmap Right . right'
    lmap (left f) . right' ≡ rmap (left f) . right'
    right' . right' ≡ dimap unassocE assocE . right' where
      assocE :: Either (Either a b) c -> Either a (Either b c)
      assocE (Left (Left a)) = Left a
      assocE (Left (Right b)) = Right (Left b)
      assocE (Right c) = Right (Right c)
      unassocE :: Either a (Either b c) -> Either (Either a b) c
      unassocE (Left a) = Left (Left a)
      unassocE (Right (Left b)) = Left (Right b)
      unassocE (Right (Right c)) = Right c

#### Instances

Instances details

Choice ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) Source # right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) Source #
Choice ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) Source # right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) Source #
Monad m => Choice (Kleisli m) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Kleisli m a b -> Kleisli m (Either a c) (Either b c) Source # right' :: Kleisli m a b -> Kleisli m (Either c a) (Either c b) Source #
Choice (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods left' :: Indexed i a b -> Indexed i (Either a c) (Either b c) Source # right' :: Indexed i a b -> Indexed i (Either c a) (Either c b) Source #
Choice (PastroSum p) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: PastroSum p a b -> PastroSum p (Either a c) (Either b c) Source # right' :: PastroSum p a b -> PastroSum p (Either c a) (Either c b) Source #
Profunctor p => Choice (TambaraSum p) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: TambaraSum p a b -> TambaraSum p (Either a c) (Either b c) Source # right' :: TambaraSum p a b -> TambaraSum p (Either c a) (Either c b) Source #
Choice p => Choice (Tambara p) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Tambara p a b -> Tambara p (Either a c) (Either b c) Source # right' :: Tambara p a b -> Tambara p (Either c a) (Either c b) Source #
Choice (Tagged :: Type -> Type -> Type) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Tagged a b -> Tagged (Either a c) (Either b c) Source # right' :: Tagged a b -> Tagged (Either c a) (Either c b) Source #
Comonad w => Choice (Cokleisli w) | `extract` approximates `costrength`
Instance details Defined in Data.Profunctor.Choice Methods left' :: Cokleisli w a b -> Cokleisli w (Either a c) (Either b c) Source # right' :: Cokleisli w a b -> Cokleisli w (Either c a) (Either c b) Source #
Choice (Market a b) |
Instance details Defined in Control.Lens.Internal.Prism Methods left' :: Market a b a0 b0 -> Market a b (Either a0 c) (Either b0 c) Source # right' :: Market a b a0 b0 -> Market a b (Either c a0) (Either c b0) Source #
Monoid r => Choice (Forget r :: Type -> Type -> Type) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Forget r a b -> Forget r (Either a c) (Either b c) Source # right' :: Forget r a b -> Forget r (Either c a) (Either c b) Source #
Applicative f => Choice (Star f) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Star f a b -> Star f (Either a c) (Either b c) Source # right' :: Star f a b -> Star f (Either c a) (Either c b) Source #
Choice (->) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: (a -> b) -> Either a c -> Either b c Source # right' :: (a -> b) -> Either c a -> Either c b Source #
Functor f => Choice (Joker f :: Type -> Type -> Type) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Joker f a b -> Joker f (Either a c) (Either b c) Source # right' :: Joker f a b -> Joker f (Either c a) (Either c b) Source #
ArrowChoice p => Choice (WrappedArrow p) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: WrappedArrow p a b -> WrappedArrow p (Either a c) (Either b c) Source # right' :: WrappedArrow p a b -> WrappedArrow p (Either c a) (Either c b) Source #
(Choice p, Choice q) => Choice (Product p q) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Product p q a b -> Product p q (Either a c) (Either b c) Source # right' :: Product p q a b -> Product p q (Either c a) (Either c b) Source #
(Choice p, Choice q) => Choice (Sum p q) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Sum p q a b -> Sum p q (Either a c) (Either b c) Source # right' :: Sum p q a b -> Sum p q (Either c a) (Either c b) Source #
(Functor f, Choice p) => Choice (Tannen f p) |
Instance details Defined in Data.Profunctor.Choice Methods left' :: Tannen f p a b -> Tannen f p (Either a c) (Either b c) Source # right' :: Tannen f p a b -> Tannen f p (Either c a) (Either c b) Source #
(Choice p, Choice q) => Choice (Procompose p q) |
Instance details Defined in Data.Profunctor.Composition Methods left' :: Procompose p q a b -> Procompose p q (Either a c) (Either b c) Source # right' :: Procompose p q a b -> Procompose p q (Either c a) (Either c b) Source #

class (Foldable1 t, Traversable t) => Traversable1 (t :: Type -> Type) where #

Minimal complete definition

traverse1 | sequence1

Methods

traverse1 :: Apply f => (a -> f b) -> t a -> f (t b) #

#### Instances

Instances details

Traversable1 Complex |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Complex a -> f (Complex b) # sequence1 :: Apply f => Complex (f b) -> f (Complex b)
Traversable1 Identity |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Identity a -> f (Identity b) # sequence1 :: Apply f => Identity (f b) -> f (Identity b)
Traversable1 First |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> First a -> f (First b) # sequence1 :: Apply f => First (f b) -> f (First b)
Traversable1 Last |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Last a -> f (Last b) # sequence1 :: Apply f => Last (f b) -> f (Last b)
Traversable1 Max |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Max a -> f (Max b) # sequence1 :: Apply f => Max (f b) -> f (Max b)
Traversable1 Min |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Min a -> f (Min b) # sequence1 :: Apply f => Min (f b) -> f (Min b)
Traversable1 Dual |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Dual a -> f (Dual b) # sequence1 :: Apply f => Dual (f b) -> f (Dual b)
Traversable1 Product |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Product a -> f (Product b) # sequence1 :: Apply f => Product (f b) -> f (Product b)
Traversable1 Sum |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Sum a -> f (Sum b) # sequence1 :: Apply f => Sum (f b) -> f (Sum b)
Traversable1 Par1 |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Par1 a -> f (Par1 b) # sequence1 :: Apply f => Par1 (f b) -> f (Par1 b)
Traversable1 Tree |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Tree a -> f (Tree b) # sequence1 :: Apply f => Tree (f b) -> f (Tree b)
Traversable1 Plucker |
Instance details Defined in Linear.Plucker Methods traverse1 :: Apply f => (a -> f b) -> Plucker a -> f (Plucker b) # sequence1 :: Apply f => Plucker (f b) -> f (Plucker b)
Traversable1 V1 |
Instance details Defined in Linear.V1 Methods traverse1 :: Apply f => (a -> f b) -> V1 a -> f (V1 b) # sequence1 :: Apply f => V1 (f b) -> f (V1 b)
Traversable1 V2 |
Instance details Defined in Linear.V2 Methods traverse1 :: Apply f => (a -> f b) -> V2 a -> f (V2 b) # sequence1 :: Apply f => V2 (f b) -> f (V2 b)
Traversable1 V3 |
Instance details Defined in Linear.V3 Methods traverse1 :: Apply f => (a -> f b) -> V3 a -> f (V3 b) # sequence1 :: Apply f => V3 (f b) -> f (V3 b)
Traversable1 V4 |
Instance details Defined in Linear.V4 Methods traverse1 :: Apply f => (a -> f b) -> V4 a -> f (V4 b) # sequence1 :: Apply f => V4 (f b) -> f (V4 b)
Traversable1 NonEmpty |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) # sequence1 :: Apply f => NonEmpty (f b) -> f (NonEmpty b)
Traversable1 (V1 :: Type -> Type) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> V1 a -> f (V1 b) # sequence1 :: Apply f => V1 (f b) -> f (V1 b)
Traversable1 f => Traversable1 (Cofree f) |
Instance details Defined in Control.Comonad.Cofree Methods traverse1 :: Apply f0 => (a -> f0 b) -> Cofree f a -> f0 (Cofree f b) # sequence1 :: Apply f0 => Cofree f (f0 b) -> f0 (Cofree f b)
Traversable1 f => Traversable1 (Free f) |
Instance details Defined in Control.Monad.Free Methods traverse1 :: Apply f0 => (a -> f0 b) -> Free f a -> f0 (Free f b) # sequence1 :: Apply f0 => Free f (f0 b) -> f0 (Free f b)
Traversable1 f => Traversable1 (Yoneda f) |
Instance details Defined in Data.Functor.Yoneda Methods traverse1 :: Apply f0 => (a -> f0 b) -> Yoneda f a -> f0 (Yoneda f b) # sequence1 :: Apply f0 => Yoneda f (f0 b) -> f0 (Yoneda f b)
Traversable1 f => Traversable1 (Lift f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Lift f a -> f0 (Lift f b) # sequence1 :: Apply f0 => Lift f (f0 b) -> f0 (Lift f b)
Traversable1 ((,) a) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a0 -> f b) -> (a, a0) -> f (a, b) # sequence1 :: Apply f => (a, f b) -> f (a, b)
Traversable1 f => Traversable1 (Alt f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Alt f a -> f0 (Alt f b) # sequence1 :: Apply f0 => Alt f (f0 b) -> f0 (Alt f b)
Traversable1 f => Traversable1 (Rec1 f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) # sequence1 :: Apply f0 => Rec1 f (f0 b) -> f0 (Rec1 f b)
Bitraversable1 p => Traversable1 (Join p) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a -> f b) -> Join p a -> f (Join p b) # sequence1 :: Apply f => Join p (f b) -> f (Join p b)
Traversable1 f => Traversable1 (AlongsideLeft f b) |
Instance details Defined in Control.Lens.Internal.Getter Methods traverse1 :: Apply f0 => (a -> f0 b0) -> AlongsideLeft f b a -> f0 (AlongsideLeft f b b0) # sequence1 :: Apply f0 => AlongsideLeft f b (f0 b0) -> f0 (AlongsideLeft f b b0)
Traversable1 f => Traversable1 (AlongsideRight f a) |
Instance details Defined in Control.Lens.Internal.Getter Methods traverse1 :: Apply f0 => (a0 -> f0 b) -> AlongsideRight f a a0 -> f0 (AlongsideRight f a b) # sequence1 :: Apply f0 => AlongsideRight f a (f0 b) -> f0 (AlongsideRight f a b)
Traversable1 (Tagged a) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a0 -> f b) -> Tagged a a0 -> f (Tagged a b) # sequence1 :: Apply f => Tagged a (f b) -> f (Tagged a b)
Traversable1 f => Traversable1 (Backwards f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Backwards f a -> f0 (Backwards f b) # sequence1 :: Apply f0 => Backwards f (f0 b) -> f0 (Backwards f b)
Traversable1 f => Traversable1 (IdentityT f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> IdentityT f a -> f0 (IdentityT f b) # sequence1 :: Apply f0 => IdentityT f (f0 b) -> f0 (IdentityT f b)
Traversable1 f => Traversable1 (Reverse f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Reverse f a -> f0 (Reverse f b) # sequence1 :: Apply f0 => Reverse f (f0 b) -> f0 (Reverse f b)
(Traversable1 f, Traversable1 g) => Traversable1 (Product f g) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) # sequence1 :: Apply f0 => Product f g (f0 b) -> f0 (Product f g b)
(Traversable1 f, Traversable1 g) => Traversable1 (Sum f g) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) # sequence1 :: Apply f0 => Sum f g (f0 b) -> f0 (Sum f g b)
(Traversable1 f, Traversable1 g) => Traversable1 (f :*: g) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) # sequence1 :: Apply f0 => (f :*: g) (f0 b) -> f0 ((f :*: g) b)
(Traversable1 f, Traversable1 g) => Traversable1 (f :+: g) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) # sequence1 :: Apply f0 => (f :+: g) (f0 b) -> f0 ((f :+: g) b)
(Traversable1 f, Traversable1 g) => Traversable1 (Compose f g) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) # sequence1 :: Apply f0 => Compose f g (f0 b) -> f0 (Compose f g b)
(Traversable1 f, Traversable1 g) => Traversable1 (f :.: g) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) # sequence1 :: Apply f0 => (f :.: g) (f0 b) -> f0 ((f :.: g) b)
Traversable1 f => Traversable1 (M1 i c f) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) # sequence1 :: Apply f0 => M1 i c f (f0 b) -> f0 (M1 i c f b)
Traversable1 g => Traversable1 (Joker g a) |
Instance details Defined in Data.Semigroup.Traversable.Class Methods traverse1 :: Apply f => (a0 -> f b) -> Joker g a a0 -> f (Joker g a b) # sequence1 :: Apply f => Joker g a (f b) -> f (Joker g a b)

class Reversing t where Source #

This class provides a generalized notion of list reversal extended to other containers.

Methods

reversing :: t -> t Source #

#### Instances

Instances details

Reversing ByteString |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: ByteString -> ByteString Source #
Reversing ByteString |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: ByteString -> ByteString Source #
Reversing Text |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Text -> Text Source #
Reversing Text |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Text -> Text Source #
Reversing (Seq a) |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Seq a -> Seq a Source #
(Metric v, OrderedField n) => Reversing (Located (Trail v n)) Source # | Same as `reverseLocTrail`.
Instance details Defined in Diagrams.Trail Methods reversing :: Located (Trail v n) -> Located (Trail v n) Source #
(Metric v, OrderedField n) => Reversing (Located (Trail' l v n)) Source # | Same as `reverseLocLine` or `reverseLocLoop`.
Instance details Defined in Diagrams.Trail Methods reversing :: Located (Trail' l v n) -> Located (Trail' l v n) Source #
Reversing (Vector a) |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Vector a -> Vector a Source #
Prim a => Reversing (Vector a) |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Vector a -> Vector a Source #
Storable a => Reversing (Vector a) |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Vector a -> Vector a Source #
Unbox a => Reversing (Vector a) |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: Vector a -> Vector a Source #
Reversing (NonEmpty a) |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: NonEmpty a -> NonEmpty a Source #
Reversing [a] |
Instance details Defined in Control.Lens.Internal.Iso Methods reversing :: [a] -> [a] Source #
(Metric v, OrderedField n) => Reversing (Path v n) Source # | Same as `reversePath`.
Instance details Defined in Diagrams.Path Methods reversing :: Path v n -> Path v n Source #
Reversing (FixedSegment v n) Source # | Reverses the control points.
Instance details Defined in Diagrams.Segment Methods reversing :: FixedSegment v n -> FixedSegment v n Source #
(Metric v, OrderedField n) => Reversing (Trail v n) Source # | Same as `reverseTrail`.
Instance details Defined in Diagrams.Trail Methods reversing :: Trail v n -> Trail v n Source #
(Additive v, Num n) => Reversing (Offset c v n) Source # | Reverses the direction of closed offsets.
Instance details Defined in Diagrams.Segment Methods reversing :: Offset c v n -> Offset c v n Source #
(Additive v, Num n) => Reversing (Segment Closed v n) Source # | Reverse the direction of a segment.
Instance details Defined in Diagrams.Segment Methods reversing :: Segment Closed v n -> Segment Closed v n Source #
(Metric v, OrderedField n) => Reversing (Trail' l v n) Source # | Same as `reverseLine` or `reverseLoop`.
Instance details Defined in Diagrams.Trail Methods reversing :: Trail' l v n -> Trail' l v n Source #

data Level i a Source #

This data type represents a path-compressed copy of one level of a source data structure. We can safely use path-compression because we know the depth of the tree.

Path compression is performed by viewing a `Level` as a PATRICIA trie of the paths into the structure to leaves at a given depth, similar in many ways to a `IntMap`, but unlike a regular PATRICIA trie we do not need to store the mask bits merely the depth of the fork.

One invariant of this structure is that underneath a `Two` node you will not find any `Zero` nodes, so `Zero` can only occur at the root.

#### Instances

Instances details

FoldableWithIndex i (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods ifoldMap :: Monoid m => (i -> a -> m) -> Level i a -> m # ifoldMap' :: Monoid m => (i -> a -> m) -> Level i a -> m # ifoldr :: (i -> a -> b -> b) -> b -> Level i a -> b # ifoldl :: (i -> b -> a -> b) -> b -> Level i a -> b # ifoldr' :: (i -> a -> b -> b) -> b -> Level i a -> b # ifoldl' :: (i -> b -> a -> b) -> b -> Level i a -> b #
FunctorWithIndex i (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods imap :: (i -> a -> b) -> Level i a -> Level i b #
TraversableWithIndex i (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods itraverse :: Applicative f => (i -> a -> f b) -> Level i a -> f (Level i b) #
Foldable (Level i) |

Instance details

Defined in Control.Lens.Internal.Level

Methods

fold :: Monoid m => Level i m -> m Source #

foldMap :: Monoid m => (a -> m) -> Level i a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Level i a -> m Source #

foldr :: (a -> b -> b) -> b -> Level i a -> b Source #

foldr' :: (a -> b -> b) -> b -> Level i a -> b Source #

foldl :: (b -> a -> b) -> b -> Level i a -> b Source #

foldl' :: (b -> a -> b) -> b -> Level i a -> b Source #

foldr1 :: (a -> a -> a) -> Level i a -> a Source #

foldl1 :: (a -> a -> a) -> Level i a -> a Source #

toList :: Level i a -> [a] Source #

null :: Level i a -> Bool Source #

length :: Level i a -> Int Source #

elem :: Eq a => a -> Level i a -> Bool Source #

maximum :: Ord a => Level i a -> a Source #

minimum :: Ord a => Level i a -> a Source #

sum :: Num a => Level i a -> a Source #

product :: Num a => Level i a -> a Source #

Traversable (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods traverse :: Applicative f => (a -> f b) -> Level i a -> f (Level i b) Source # sequenceA :: Applicative f => Level i (f a) -> f (Level i a) Source # mapM :: Monad m => (a -> m b) -> Level i a -> m (Level i b) Source # sequence :: Monad m => Level i (m a) -> m (Level i a) Source #
Functor (Level i) |
Instance details Defined in Control.Lens.Internal.Level Methods fmap :: (a -> b) -> Level i a -> Level i b Source # (<$) :: a -> Level i b -> Level i a Source #
(Read i, Read a) => Read (Level i a) |
Instance details Defined in Control.Lens.Internal.Level Methods readsPrec :: Int -> ReadS (Level i a) Source # readList :: ReadS [Level i a] Source # readPrec :: ReadPrec (Level i a) Source # readListPrec :: ReadPrec [Level i a] Source #
(Show i, Show a) => Show (Level i a) |
Instance details Defined in Control.Lens.Internal.Level Methods showsPrec :: Int -> Level i a -> ShowS Source # show :: Level i a -> String Source # showList :: [Level i a] -> ShowS Source #
(Eq i, Eq a) => Eq (Level i a) |
Instance details Defined in Control.Lens.Internal.Level Methods (==) :: Level i a -> Level i a -> Bool Source # (/=) :: Level i a -> Level i a -> Bool Source #
(Ord i, Ord a) => Ord (Level i a) |

Instance details

Defined in Control.Lens.Internal.Level

Methods

compare :: Level i a -> Level i a -> Ordering Source #

(<) :: Level i a -> Level i a -> Bool Source #

(<=) :: Level i a -> Level i a -> Bool Source #

(>) :: Level i a -> Level i a -> Bool Source #

(>=) :: Level i a -> Level i a -> Bool Source #

max :: Level i a -> Level i a -> Level i a Source #

min :: Level i a -> Level i a -> Level i a Source #

class Conjoined p => Indexable i (p :: Type -> Type -> Type) Source #

This class permits overloading of function application for things that also admit a notion of a key or index.

Minimal complete definition

indexed

#### Instances

Instances details

i ~ j => Indexable i (Indexed j) |
Instance details Defined in Control.Lens.Internal.Indexed Methods indexed :: Indexed j a b -> i -> a -> b Source #
Indexable i (->) |
Instance details Defined in Control.Lens.Internal.Indexed Methods indexed :: (a -> b) -> i -> a -> b Source #

class (Choice p, Corepresentable p, Comonad (Corep p), Traversable (Corep p), Strong p, Representable p, Monad (Rep p), MonadFix (Rep p), Distributive (Rep p), Costrong p, ArrowLoop p, ArrowApply p, ArrowChoice p, Closed p) => Conjoined (p :: Type -> Type -> Type) where Source #

This is a `Profunctor` that is both `Corepresentable` by `f` and `Representable` by `g` such that `f` is left adjoint to `g`. From this you can derive a lot of structure due to the preservation of limits and colimits.

Minimal complete definition

Nothing

Methods

distrib :: Functor f => p a b -> p (f a) (f b) Source #

`Conjoined` is strong enough to let us distribute every `Conjoined` `Profunctor` over every Haskell `Functor`. This is effectively a generalization of `fmap`.

conjoined :: (p ~ (->) => q (a -> b) r) -> q (p a b) r -> q (p a b) r Source #

This permits us to make a decision at an outermost point about whether or not we use an index.

Ideally any use of this function should be done in such a way so that you compute the same answer, but this cannot be enforced at the type level.

#### Instances

Instances details

Conjoined ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) Source # conjoined :: (ReifiedGetter ~ (->) => q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r Source #
Conjoined (Indexed i) |
Instance details Defined in Control.Lens.Internal.Indexed Methods distrib :: Functor f => Indexed i a b -> Indexed i (f a) (f b) Source # conjoined :: (Indexed i ~ (->) => q (a -> b) r) -> q (Indexed i a b) r -> q (Indexed i a b) r Source #
Conjoined (->) |
Instance details Defined in Control.Lens.Internal.Indexed Methods distrib :: Functor f => (a -> b) -> f a -> f b Source # conjoined :: ((->) ~ (->) => q (a -> b) r) -> q (a -> b) r -> q (a -> b) r Source #

data Rightmost a Source #

Used for `lastOf`.

#### Instances

Instances details

Monoid (Rightmost a) |
Instance details Defined in Control.Lens.Internal.Fold Methods mempty :: Rightmost a Source # mappend :: Rightmost a -> Rightmost a -> Rightmost a Source # mconcat :: [Rightmost a] -> Rightmost a Source #
Semigroup (Rightmost a) |
Instance details Defined in Control.Lens.Internal.Fold Methods (<>) :: Rightmost a -> Rightmost a -> Rightmost a Source # sconcat :: NonEmpty (Rightmost a) -> Rightmost a Source # stimes :: Integral b => b -> Rightmost a -> Rightmost a Source #

data Leftmost a Source #

Used for `firstOf`.

#### Instances

Instances details

Monoid (Leftmost a) |
Instance details Defined in Control.Lens.Internal.Fold Methods mempty :: Leftmost a Source # mappend :: Leftmost a -> Leftmost a -> Leftmost a Source # mconcat :: [Leftmost a] -> Leftmost a Source #
Semigroup (Leftmost a) |
Instance details Defined in Control.Lens.Internal.Fold Methods (<>) :: Leftmost a -> Leftmost a -> Leftmost a Source # sconcat :: NonEmpty (Leftmost a) -> Leftmost a Source # stimes :: Integral b => b -> Leftmost a -> Leftmost a Source #

data Sequenced a (m :: Type -> Type) Source #

Used internally by `mapM_` and the like.

The argument `a` of the result should not be used!

See 4.16 Changelog entry for the explanation of "why not Apply f =>"?

#### Instances

Instances details

Monad m => Monoid (Sequenced a m) |
Instance details Defined in Control.Lens.Internal.Fold Methods mempty :: Sequenced a m Source # mappend :: Sequenced a m -> Sequenced a m -> Sequenced a m Source # mconcat :: [Sequenced a m] -> Sequenced a m Source #
Monad m => Semigroup (Sequenced a m) |
Instance details Defined in Control.Lens.Internal.Fold Methods (<>) :: Sequenced a m -> Sequenced a m -> Sequenced a m Source # sconcat :: NonEmpty (Sequenced a m) -> Sequenced a m Source # stimes :: Integral b => b -> Sequenced a m -> Sequenced a m Source #

data Traversed a (f :: Type -> Type) Source #

Used internally by `traverseOf_` and the like.

The argument `a` of the result should not be used!

#### Instances

Instances details

Applicative f => Monoid (Traversed a f) |
Instance details Defined in Control.Lens.Internal.Fold Methods mempty :: Traversed a f Source # mappend :: Traversed a f -> Traversed a f -> Traversed a f Source # mconcat :: [Traversed a f] -> Traversed a f Source #
Applicative f => Semigroup (Traversed a f) |
Instance details Defined in Control.Lens.Internal.Fold Methods (<>) :: Traversed a f -> Traversed a f -> Traversed a f Source # sconcat :: NonEmpty (Traversed a f) -> Traversed a f Source # stimes :: Integral b => b -> Traversed a f -> Traversed a f Source #

type Context' a = Context a a Source #

    type Context' a s = Context a a s

data Context a b t Source #

The indexed store can be used to characterize a `Lens` and is used by `cloneLens`.

``Context` a b t` is isomorphic to `newtype `Context` a b t = `Context` { runContext :: forall f. `Functor` f => (a -> f b) -> f t }`, and to `exists s. (s, `Lens` s t a b)`.

A `Context` is like a `Lens` that has already been applied to a some structure.

Constructors

Context (b -> t) a |

#### Instances

Instances details

IndexedComonad Context |
Instance details Defined in Control.Lens.Internal.Context Methods iextract :: Context a a t -> t Source # iduplicate :: Context a c t -> Context a b (Context b c t) Source # iextend :: (Context b c t -> r) -> Context a c t -> Context a b r Source #
IndexedComonadStore Context |

Instance details

Defined in Control.Lens.Internal.Context

Methods

ipos :: Context a c t -> a Source #

ipeek :: c -> Context a c t -> t Source #

ipeeks :: (a -> c) -> Context a c t -> t Source #

iseek :: b -> Context a c t -> Context b c t Source #

iseeks :: (a -> b) -> Context a c t -> Context b c t Source #

iexperiment :: Functor f => (b -> f c) -> Context b c t -> f t Source #

context :: Context a b t -> Context a b t Source #

IndexedFunctor Context |
Instance details Defined in Control.Lens.Internal.Context Methods ifmap :: (s -> t) -> Context a b s -> Context a b t Source #
a ~ b => ComonadStore a (Context a b) |
Instance details Defined in Control.Lens.Internal.Context Methods pos :: Context a b a0 -> a # peek :: a -> Context a b a0 -> a0 # peeks :: (a -> a) -> Context a b a0 -> a0 # seek :: a -> Context a b a0 -> Context a b a0 # seeks :: (a -> a) -> Context a b a0 -> Context a b a0 # experiment :: Functor f => (a -> f a) -> Context a b a0 -> f a0 #
Functor (Context a b) |
Instance details Defined in Control.Lens.Internal.Context Methods fmap :: (a0 -> b0) -> Context a b a0 -> Context a b b0 Source # (<$) :: a0 -> Context a b b0 -> Context a b a0 Source #
a ~ b => Comonad (Context a b) |
Instance details Defined in Control.Lens.Internal.Context Methods extract :: Context a b a0 -> a0 duplicate :: Context a b a0 -> Context a b (Context a b a0) extend :: (Context a b a0 -> b0) -> Context a b a0 -> Context a b b0
Sellable (->) Context |
Instance details Defined in Control.Lens.Internal.Context Methods sell :: a -> Context a b b Source #

type Bazaar1' (p :: Type -> Type -> Type) a = Bazaar1 p a a Source #

This alias is helpful when it comes to reducing repetition in type signatures.

    type Bazaar1' p a t = Bazaar1 p a a t

newtype Bazaar1 (p :: Type -> Type -> Type) a b t Source #

This is used to characterize a `Traversal`.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed `FunList`.

http://twanvl.nl/blog/haskell/non-regular1

A `Bazaar1` is like a `Traversal` that has already been applied to some structure.

Where a ``Context` a b t` holds an `a` and a function from `b` to `t`, a ``Bazaar1` a b t` holds `N` `a`s and a function from `N` `b`s to `t`, (where `N` might be infinite).

Mnemonically, a `Bazaar1` holds many stores and you can easily add more.

This is a final encoding of `Bazaar1`.

Constructors

Bazaar1 |

Fields

- runBazaar1 :: forall (f :: Type -> Type). Apply f => p a (f b) -> f t

#### Instances

Instances details

Profunctor p => Bizarre1 p (Bazaar1 p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods bazaar1 :: Apply f => p a (f b) -> Bazaar1 p a b t -> f t Source #
Corepresentable p => Sellable p (Bazaar1 p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods sell :: p a (Bazaar1 p a b b) Source #
Conjoined p => IndexedComonad (Bazaar1 p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods iextract :: Bazaar1 p a a t -> t Source # iduplicate :: Bazaar1 p a c t -> Bazaar1 p a b (Bazaar1 p b c t) Source # iextend :: (Bazaar1 p b c t -> r) -> Bazaar1 p a c t -> Bazaar1 p a b r Source #
IndexedFunctor (Bazaar1 p) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods ifmap :: (s -> t) -> Bazaar1 p a b s -> Bazaar1 p a b t Source #
Functor (Bazaar1 p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods fmap :: (a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 Source # (<$) :: a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b a0 Source #
(a ~ b, Conjoined p) => Comonad (Bazaar1 p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods extract :: Bazaar1 p a b a0 -> a0 duplicate :: Bazaar1 p a b a0 -> Bazaar1 p a b (Bazaar1 p a b a0) extend :: (Bazaar1 p a b a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0
(a ~ b, Conjoined p) => ComonadApply (Bazaar1 p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods (<@>) :: Bazaar1 p a b (a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 (@>) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b b0 (<@) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b a0
Apply (Bazaar1 p a b) |
Instance details Defined in Control.Lens.Internal.Bazaar Methods (<.>) :: Bazaar1 p a b (a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 (.>) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b b0 (<.) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b a0 liftF2 :: (a0 -> b0 -> c) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b c

type Bazaar' (p :: Type -> Type -> Type) a = Bazaar p a a Source #

This alias is helpful when it comes to reducing repetition in type signatures.

    type Bazaar' p a t = Bazaar p a a t

data Magma i t b a Source #

This provides a way to peek at the internal structure of a `Traversal` or `IndexedTraversal`

#### Instances

Instances details

FoldableWithIndex i (Magma i t b) |

Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifoldr :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldr' :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl' :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

FunctorWithIndex i (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods imap :: (i -> a -> b0) -> Magma i t b a -> Magma i t b b0 #
TraversableWithIndex i (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods itraverse :: Applicative f => (i -> a -> f b0) -> Magma i t b a -> f (Magma i t b b0) #
Foldable (Magma i t b) |

Instance details

Defined in Control.Lens.Internal.Magma

Methods

fold :: Monoid m => Magma i t b m -> m Source #

foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Magma i t b a -> m Source #

foldr :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldr' :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldl :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldl' :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldr1 :: (a -> a -> a) -> Magma i t b a -> a Source #

foldl1 :: (a -> a -> a) -> Magma i t b a -> a Source #

toList :: Magma i t b a -> [a] Source #

null :: Magma i t b a -> Bool Source #

length :: Magma i t b a -> Int Source #

elem :: Eq a => a -> Magma i t b a -> Bool Source #

maximum :: Ord a => Magma i t b a -> a Source #

minimum :: Ord a => Magma i t b a -> a Source #

sum :: Num a => Magma i t b a -> a Source #

product :: Num a => Magma i t b a -> a Source #

Traversable (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods traverse :: Applicative f => (a -> f b0) -> Magma i t b a -> f (Magma i t b b0) Source # sequenceA :: Applicative f => Magma i t b (f a) -> f (Magma i t b a) Source # mapM :: Monad m => (a -> m b0) -> Magma i t b a -> m (Magma i t b b0) Source # sequence :: Monad m => Magma i t b (m a) -> m (Magma i t b a) Source #
Functor (Magma i t b) |
Instance details Defined in Control.Lens.Internal.Magma Methods fmap :: (a -> b0) -> Magma i t b a -> Magma i t b b0 Source # (<$) :: a -> Magma i t b b0 -> Magma i t b a Source #
(Show i, Show a) => Show (Magma i t b a) |
Instance details Defined in Control.Lens.Internal.Magma Methods showsPrec :: Int -> Magma i t b a -> ShowS Source # show :: Magma i t b a -> String Source # showList :: [Magma i t b a] -> ShowS Source #

class (Profunctor p, Bifunctor p) => Reviewable (p :: Type -> Type -> Type) Source #

This class is provided mostly for backwards compatibility with lens 3.8, but it can also shorten type signatures.

#### Instances

Instances details

(Profunctor p, Bifunctor p) => Reviewable p |
Instance details Defined in Control.Lens.Internal.Review

class (Applicative f, Distributive f, Traversable f) => Settable (f :: Type -> Type) Source #

Anything `Settable` must be isomorphic to the `Identity` `Functor`.

Minimal complete definition

untainted

#### Instances

Instances details

Settable Identity | So you can pass our `Setter` into combinators from other lens libraries.
Instance details Defined in Control.Lens.Internal.Setter Methods untainted :: Identity a -> a Source # untaintedDot :: Profunctor p => p a (Identity b) -> p a b Source # taintedDot :: Profunctor p => p a b -> p a (Identity b) Source #
Settable f => Settable (Backwards f) | `backwards`
Instance details Defined in Control.Lens.Internal.Setter Methods untainted :: Backwards f a -> a Source # untaintedDot :: Profunctor p => p a (Backwards f b) -> p a b Source # taintedDot :: Profunctor p => p a b -> p a (Backwards f b) Source #
(Settable f, Settable g) => Settable (Compose f g) |
Instance details Defined in Control.Lens.Internal.Setter Methods untainted :: Compose f g a -> a Source # untaintedDot :: Profunctor p => p a (Compose f g b) -> p a b Source # taintedDot :: Profunctor p => p a b -> p a (Compose f g b) Source #

type Over' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Over p f s s a a Source #

This is a convenient alias for use when you need to consume either indexed or non-indexed lens-likes based on context.

    type Over' p f = Simple (Over p f)

type IndexedLensLike' i (f :: Type -> Type) s a = IndexedLensLike i f s s a a Source #

Convenient alias for constructing simple indexed lenses and their ilk.

type IndexedLensLike i (f :: k -> Type) s (t :: k) a (b :: k) = forall (p :: Type -> Type -> Type). Indexable i p => p a (f b) -> s -> f t Source #

Convenient alias for constructing indexed lenses and their ilk.

type LensLike' (f :: Type -> Type) s a = LensLike f s s a a Source #

    type LensLike' f = Simple (LensLike f)

type Optical' (p :: k -> k1 -> Type) (q :: k -> k1 -> Type) (f :: k -> k1) (s :: k) (a :: k) = Optical p q f s s a a Source #

    type Optical' p q f s a = Simple (Optical p q f) s a

type Optical (p :: k -> k1 -> Type) (q :: k2 -> k1 -> Type) (f :: k3 -> k1) (s :: k2) (t :: k3) (a :: k) (b :: k3) = p a (f b) -> q s (f t) Source #

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

    type Over p f s t a b = Optical p (->) f s t a b

    type Optic p f s t a b = Optical p p f s t a b

type Optic' (p :: k -> k1 -> Type) (f :: k -> k1) (s :: k) (a :: k) = Optic p f s s a a Source #

    type Optic' p f s a = Simple (Optic p f) s a

type Optic (p :: k -> k1 -> Type) (f :: k2 -> k1) (s :: k) (t :: k2) (a :: k) (b :: k2) = p a (f b) -> p s (f t) Source #

A valid `Optic` `l` should satisfy the laws:

    l pure ≡ pure
    l (Procompose f g) = Procompose (l f) (l g)

This gives rise to the laws for `Equality`, `Iso`, `Prism`, `Lens`, `Traversal`, `Traversal1`, `Setter`, `Fold`, `Fold1`, and `Getter` as well along with their index-preserving variants.

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

type IndexPreservingFold1 s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Apply f) => p a (f a) -> p s (f s) Source #

type IndexedFold1 i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Apply f) => p a (f a) -> s -> f s Source #

type Fold1 s a = forall (f :: Type -> Type). (Contravariant f, Apply f) => (a -> f a) -> s -> f s Source #

A relevant Fold (aka `Fold1`) has one or more targets.

type IndexPreservingFold s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Applicative f) => p a (f a) -> p s (f s) Source #

An `IndexPreservingFold` can be used as a `Fold`, but when composed with an `IndexedTraversal`, `IndexedFold`, or `IndexedLens` yields an `IndexedFold` respectively.

type IndexPreservingGetter s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Functor f) => p a (f a) -> p s (f s) Source #

An `IndexPreservingGetter` can be used as a `Getter`, but when composed with an `IndexedTraversal`, `IndexedFold`, or `IndexedLens` yields an `IndexedFold`, `IndexedFold` or `IndexedGetter` respectively.

type As (a :: k2) = Equality' a a Source #

Composable `asTypeOf`. Useful for constraining excess polymorphism, `foo . (id :: As Int) . bar`.

type Equality' (s :: k2) (a :: k2) = Equality s s a a Source #

A `Simple` `Equality`.

type Equality (s :: k1) (t :: k2) (a :: k1) (b :: k2) = forall k3 (p :: k1 -> k3 -> Type) (f :: k2 -> k3). p a (f b) -> p s (f t) Source #

A witness that `(a ~ s, b ~ t)`.

Note: Composition with an `Equality` is index-preserving.

type AReview t b = Optic' (Tagged :: Type -> Type -> Type) Identity t b Source #

If you see this in a signature for a function, the function is expecting a `Review` (in practice, this usually means a `Prism`).

type Review t b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Choice p, Bifunctor p, Settable f) => Optic' p f t b Source #

This is a limited form of a `Prism` that can only be used for `re` operations.

Like with a `Getter`, there are no laws to state for a `Review`.

You can generate a `Review` by using `unto`. You can also use any `Prism` or `Iso` directly as a `Review`.

type IndexPreservingSetter' s a = IndexPreservingSetter s s a a Source #

    type IndexedPreservingSetter' i = Simple IndexedPreservingSetter

type IndexPreservingSetter s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Settable f) => p a (f b) -> p s (f t) Source #

An `IndexPreservingSetter` can be composed with a `IndexedSetter`, `IndexedTraversal` or `IndexedLens` and leaves the index intact, yielding an `IndexedSetter`.

type IndexedSetter' i s a = IndexedSetter i s s a a Source #

    type IndexedSetter' i = Simple (IndexedSetter i)

type IndexedSetter i s t a b = forall (f :: Type -> Type) (p :: Type -> Type -> Type). (Indexable i p, Settable f) => p a (f b) -> s -> f t Source #

Every `IndexedSetter` is a valid `Setter`.

The `Setter` laws are still required to hold.

type IndexPreservingTraversal1' s a = IndexPreservingTraversal1 s s a a Source #

type IndexPreservingTraversal1 s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Apply f) => p a (f b) -> p s (f t) Source #

type IndexPreservingTraversal' s a = IndexPreservingTraversal s s a a Source #

    type IndexPreservingTraversal' = Simple IndexPreservingTraversal

type IndexPreservingTraversal s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Applicative f) => p a (f b) -> p s (f t) Source #

An `IndexPreservingTraversal` leaves any index it is composed with alone.

type IndexedTraversal1' i s a = IndexedTraversal1 i s s a a Source #

type IndexedTraversal1 i s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Apply f) => p a (f b) -> s -> f t Source #

type IndexedTraversal' i s a = IndexedTraversal i s s a a Source #

    type IndexedTraversal' i = Simple (IndexedTraversal i)

type Traversal1' s a = Traversal1 s s a a Source #

type Traversal1 s t a b = forall (f :: Type -> Type). Apply f => (a -> f b) -> s -> f t Source #

A `Traversal` which targets at least one element.

Note that since `Apply` is not a superclass of `Applicative`, a `Traversal1` cannot always be used in place of a `Traversal`. In such circumstances `cloneTraversal` will convert a `Traversal1` into a `Traversal`.

type IndexPreservingLens' s a = IndexPreservingLens s s a a Source #

    type IndexPreservingLens' = Simple IndexPreservingLens

type IndexPreservingLens s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Functor f) => p a (f b) -> p s (f t) Source #

An `IndexPreservingLens` leaves any index it is composed with alone.

type IndexedLens' i s a = IndexedLens i s s a a Source #

    type IndexedLens' i = Simple (IndexedLens i)

type Setting' (p :: Type -> Type -> Type) s a = Setting p s s a a Source #

This is a convenient alias when defining highly polymorphic code that takes both `ASetter'` and `AnIndexedSetter'` as appropriate. If a function takes this it is expecting one of those two things based on context.

type Setting (p :: Type -> Type -> Type) s t a b = p a (Identity b) -> s -> Identity t Source #

This is a convenient alias when defining highly polymorphic code that takes both `ASetter` and `AnIndexedSetter` as appropriate. If a function takes this it is expecting one of those two things based on context.

type AnIndexedSetter' i s a = AnIndexedSetter i s s a a Source #

    type AnIndexedSetter' i = Simple (AnIndexedSetter i)

type AnIndexedSetter i s t a b = Indexed i a (Identity b) -> s -> Identity t Source #

Running an `IndexedSetter` instantiates it to a concrete type.

When consuming a setter directly to perform a mapping, you can use this type, but most user code will not need to use this type.

type ASetter' s a = ASetter s s a a Source #

This is a useful alias for use when consuming a `Setter'`.

Most user code will never have to use this type.

    type ASetter' = Simple ASetter

type ASetter s t a b = (a -> Identity b) -> s -> Identity t Source #

Running a `Setter` instantiates it to a concrete type.

When consuming a setter directly to perform a mapping, you can use this type, but most user code will not need to use this type.

type AnIndexedLens' i s a = AnIndexedLens i s s a a Source #

    type AnIndexedLens' = Simple (AnIndexedLens i)

type AnIndexedLens i s t a b = Optical (Indexed i) (->) (Pretext (Indexed i) a b) s t a b Source #

When you see this as an argument to a function, it expects an `IndexedLens`

type ALens' s a = ALens s s a a Source #

    type ALens' = Simple ALens

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

When you see this as an argument to a function, it expects a `Lens`.

This type can also be used when you need to store a `Lens` in a container, since it is rank-1. You can turn them back into a `Lens` with `cloneLens`, or use it directly with combinators like `storing` and (`^#`).

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

Provides access to the 19th field of a tuple.

Minimal complete definition

Nothing

Methods

_19 :: Lens s t a b Source #

Access the 19th field of a tuple.

#### Instances

Instances details

19 <= n => Field19 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _19 :: Lens (V n a) (V n a) a a Source #
Field19 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s') s s' |
Instance details Defined in Control.Lens.Tuple Methods _19 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s') s s' Source #

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

Provides access to the 18th field of a tuple.

Minimal complete definition

Nothing

Methods

_18 :: Lens s t a b Source #

Access the 18th field of a tuple.

#### Instances

Instances details

18 <= n => Field18 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _18 :: Lens (V n a) (V n a) a a Source #
Field18 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r') r r' |
Instance details Defined in Control.Lens.Tuple Methods _18 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r') r r' Source #
Field18 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r', s) r r' |
Instance details Defined in Control.Lens.Tuple Methods _18 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r', s) r r' Source #

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

Provides access to the 17th field of a tuple.

Minimal complete definition

Nothing

Methods

_17 :: Lens s t a b Source #

Access the 17th field of a tuple.

#### Instances

Instances details

17 <= n => Field17 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _17 :: Lens (V n a) (V n a) a a Source #
Field17 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q') q q' |
Instance details Defined in Control.Lens.Tuple Methods _17 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q') q q' Source #
Field17 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r) q q' |
Instance details Defined in Control.Lens.Tuple Methods _17 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r) q q' Source #
Field17 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r, s) q q' |
Instance details Defined in Control.Lens.Tuple Methods _17 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r, s) q q' Source #

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

Provides access to the 16th field of a tuple.

Minimal complete definition

Nothing

Methods

_16 :: Lens s t a b Source #

Access the 16th field of a tuple.

#### Instances

Instances details

16 <= n => Field16 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _16 :: Lens (V n a) (V n a) a a Source #
Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p') p p' |
Instance details Defined in Control.Lens.Tuple Methods _16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p') p p' Source #
Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q) p p' |
Instance details Defined in Control.Lens.Tuple Methods _16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q) p p' Source #
Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r) p p' |
Instance details Defined in Control.Lens.Tuple Methods _16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r) p p' Source #
Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r, s) p p' |
Instance details Defined in Control.Lens.Tuple Methods _16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r, s) p p' Source #

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

Provides access to the 15th field of a tuple.

Minimal complete definition

Nothing

Methods

_15 :: Lens s t a b Source #

Access the 15th field of a tuple.

#### Instances

Instances details

15 <= n => Field15 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _15 :: Lens (V n a) (V n a) a a Source #
Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o') o o' |
Instance details Defined in Control.Lens.Tuple Methods _15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o') o o' Source #
Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p) o o' |
Instance details Defined in Control.Lens.Tuple Methods _15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p) o o' Source #
Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q) o o' |
Instance details Defined in Control.Lens.Tuple Methods _15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q) o o' Source #
Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r) o o' |
Instance details Defined in Control.Lens.Tuple Methods _15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r) o o' Source #
Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r, s) o o' |
Instance details Defined in Control.Lens.Tuple Methods _15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r, s) o o' Source #

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

Provides access to the 14th field of a tuple.

Minimal complete definition

Nothing

Methods

_14 :: Lens s t a b Source #

Access the 14th field of a tuple.

#### Instances

Instances details

14 <= n => Field14 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _14 :: Lens (V n a) (V n a) a a Source #
Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n') n n' |
Instance details Defined in Control.Lens.Tuple Methods _14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n') n n' Source #
Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o) n n' |
Instance details Defined in Control.Lens.Tuple Methods _14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o) n n' Source #
Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p) n n' |
Instance details Defined in Control.Lens.Tuple Methods _14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p) n n' Source #
Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q) n n' |
Instance details Defined in Control.Lens.Tuple Methods _14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q) n n' Source #
Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r) n n' |
Instance details Defined in Control.Lens.Tuple Methods _14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r) n n' Source #
Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r, s) n n' |
Instance details Defined in Control.Lens.Tuple Methods _14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r, s) n n' Source #

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

Provides access to the 13th field of a tuple.

Minimal complete definition

Nothing

Methods

_13 :: Lens s t a b Source #

Access the 13th field of a tuple.

#### Instances

Instances details

13 <= n => Field13 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _13 :: Lens (V n a) (V n a) a a Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l, m') m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l, m') m m' Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n) m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n) m m' Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o) m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o) m m' Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p) m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p) m m' Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q) m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q) m m' Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r) m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r) m m' Source #
Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r, s) m m' |
Instance details Defined in Control.Lens.Tuple Methods _13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r, s) m m' Source #

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

Provides access to the 12th field of a tuple.

Minimal complete definition

Nothing

Methods

_12 :: Lens s t a b Source #

Access the 12th field of a tuple.

#### Instances

Instances details

12 <= n => Field12 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _12 :: Lens (V n a) (V n a) a a Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk, l') l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk, l') l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l', m) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l', m) l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n) l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o) l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p) l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q) l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r) l l' Source #
Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r, s) l l' |
Instance details Defined in Control.Lens.Tuple Methods _12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r, s) l l' Source #

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

Provides access to the 11th field of a tuple.

Minimal complete definition

Nothing

Methods

_11 :: Lens s t a b Source #

Access the 11th field of a tuple.

#### Instances

Instances details

11 <= n => Field11 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _11 :: Lens (V n a) (V n a) a a Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j, kk') kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j, kk') kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk', l) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk', l) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk', l, m) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk', l, m) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r) kk kk' Source #
Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r, s) kk kk' |
Instance details Defined in Control.Lens.Tuple Methods _11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r, s) kk kk' Source #

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

Provides access to the 10th field of a tuple.

Minimal complete definition

Nothing

Methods

_10 :: Lens s t a b Source #

Access the 10th field of a tuple.

#### Instances

Instances details

10 <= n => Field10 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _10 :: Lens (V n a) (V n a) a a Source #
Field10 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i, j') j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i, j') j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j', kk) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j', kk) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j', kk, l) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j', kk, l) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j', kk, l, m) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j', kk, l, m) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r) j j' Source #
Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r, s) j j' |
Instance details Defined in Control.Lens.Tuple Methods _10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r, s) j j' Source #

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

Provides access to the 9th field of a tuple.

Minimal complete definition

Nothing

Methods

_9 :: Lens s t a b Source #

Access the 9th field of a tuple.

#### Instances

Instances details

9 <= n => Field9 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _9 :: Lens (V n a) (V n a) a a Source #
Field9 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i') i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i') i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i', j) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i', j) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i', j, kk) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i', j, kk) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i', j, kk, l) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i', j, kk, l) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i', j, kk, l, m) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i', j, kk, l, m) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r) i i' Source #
Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r, s) i i' |
Instance details Defined in Control.Lens.Tuple Methods _9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r, s) i i' Source #

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

Provide access to the 8th field of a tuple.

Minimal complete definition

Nothing

Methods

_8 :: Lens s t a b Source #

Access the 8th field of a tuple.

#### Instances

Instances details

8 <= n => Field8 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _8 :: Lens (V n a) (V n a) a a Source #
Field8 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h') h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h') h h' Source #
Field8 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h', i) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h', i) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h', i, j) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h', i, j) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h', i, j, kk) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h', i, j, kk) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h', i, j, kk, l) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h', i, j, kk, l) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h', i, j, kk, l, m) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h', i, j, kk, l, m) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r) h h' Source #
Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r, s) h h' |
Instance details Defined in Control.Lens.Tuple Methods _8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r, s) h h' Source #

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

Provide access to the 7th field of a tuple.

Minimal complete definition

Nothing

Methods

_7 :: Lens s t a b Source #

Access the 7th field of a tuple.

#### Instances

Instances details

7 <= n => Field7 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _7 :: Lens (V n a) (V n a) a a Source #
Field7 (a, b, c, d, e, f, g) (a, b, c, d, e, f, g') g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e, f, g') g g' Source #
Field7 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g', h) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g', h) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g', h, i) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g', h, i) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g', h, i, j) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g', h, i, j) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g', h, i, j, kk) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g', h, i, j, kk) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g', h, i, j, kk, l) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g', h, i, j, kk, l) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g', h, i, j, kk, l, m) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g', h, i, j, kk, l, m) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r) g g' Source #
Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r, s) g g' |
Instance details Defined in Control.Lens.Tuple Methods _7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r, s) g g' Source #

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

Provides access to the 6th element of a tuple.

Minimal complete definition

Nothing

Methods

_6 :: Lens s t a b Source #

Access the 6th field of a tuple.

#### Instances

Instances details

Field6 (Plucker a) (Plucker a) a a |
Instance details Defined in Linear.Plucker Methods _6 :: Lens (Plucker a) (Plucker a) a a Source #
6 <= n => Field6 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _6 :: Lens (V n a) (V n a) a a Source #
Field6 (a, b, c, d, e, f) (a, b, c, d, e, f') f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f) (a, b, c, d, e, f') f f' Source #
Field6 (a, b, c, d, e, f, g) (a, b, c, d, e, f', g) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e, f', g) f f' Source #
Field6 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f', g, h) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f', g, h) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f', g, h, i) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f', g, h, i) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f', g, h, i, j) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f', g, h, i, j) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f', g, h, i, j, kk) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f', g, h, i, j, kk) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f', g, h, i, j, kk, l) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f', g, h, i, j, kk, l) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f', g, h, i, j, kk, l, m) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f', g, h, i, j, kk, l, m) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r) f f' Source #
Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r, s) f f' |
Instance details Defined in Control.Lens.Tuple Methods _6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r, s) f f' Source #

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

Provides access to the 5th field of a tuple.

Minimal complete definition

Nothing

Methods

_5 :: Lens s t a b Source #

Access the 5th field of a tuple.

#### Instances

Instances details

Field5 (Plucker a) (Plucker a) a a |
Instance details Defined in Linear.Plucker Methods _5 :: Lens (Plucker a) (Plucker a) a a Source #
5 <= n => Field5 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _5 :: Lens (V n a) (V n a) a a Source #
Field5 (a, b, c, d, e) (a, b, c, d, e') e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e) (a, b, c, d, e') e e' Source #
Field5 (a, b, c, d, e, f) (a, b, c, d, e', f) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f) (a, b, c, d, e', f) e e' Source #
Field5 (a, b, c, d, e, f, g) (a, b, c, d, e', f, g) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e', f, g) e e' Source #
Field5 (a, b, c, d, e, f, g, h) (a, b, c, d, e', f, g, h) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e', f, g, h) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e', f, g, h, i) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e', f, g, h, i) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e', f, g, h, i, j) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e', f, g, h, i, j) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e', f, g, h, i, j, kk) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e', f, g, h, i, j, kk) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e', f, g, h, i, j, kk, l) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e', f, g, h, i, j, kk, l) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e', f, g, h, i, j, kk, l, m) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e', f, g, h, i, j, kk, l, m) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r) e e' Source #
Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s) e e' |
Instance details Defined in Control.Lens.Tuple Methods _5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s) e e' Source #

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

Provide access to the 4th field of a tuple.

Minimal complete definition

Nothing

Methods

_4 :: Lens s t a b Source #

Access the 4th field of a tuple.

#### Instances

Instances details

Field4 (Plucker a) (Plucker a) a a |
Instance details Defined in Linear.Plucker Methods _4 :: Lens (Plucker a) (Plucker a) a a Source #
Field4 (Quaternion a) (Quaternion a) a a |
Instance details Defined in Linear.Quaternion Methods _4 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field4 (V4 a) (V4 a) a a |
Instance details Defined in Linear.V4 Methods _4 :: Lens (V4 a) (V4 a) a a Source #
4 <= n => Field4 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _4 :: Lens (V n a) (V n a) a a Source #
Field4 (a, b, c, d) (a, b, c, d') d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d) (a, b, c, d') d d' Source #
Field4 (a, b, c, d, e) (a, b, c, d', e) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e) (a, b, c, d', e) d d' Source #
Field4 (a, b, c, d, e, f) (a, b, c, d', e, f) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f) (a, b, c, d', e, f) d d' Source #
Field4 (a, b, c, d, e, f, g) (a, b, c, d', e, f, g) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g) (a, b, c, d', e, f, g) d d' Source #
Field4 (a, b, c, d, e, f, g, h) (a, b, c, d', e, f, g, h) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d', e, f, g, h) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i) (a, b, c, d', e, f, g, h, i) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d', e, f, g, h, i) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d', e, f, g, h, i, j) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d', e, f, g, h, i, j) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d', e, f, g, h, i, j, kk) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d', e, f, g, h, i, j, kk) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d', e, f, g, h, i, j, kk, l) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d', e, f, g, h, i, j, kk, l) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d', e, f, g, h, i, j, kk, l, m) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d', e, f, g, h, i, j, kk, l, m) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r) d d' Source #
Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) d d' |
Instance details Defined in Control.Lens.Tuple Methods _4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) d d' Source #

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

Provides access to the 3rd field of a tuple.

Minimal complete definition

Nothing

Methods

_3 :: Lens s t a b Source #

Access the 3rd field of a tuple.

#### Instances

Instances details

Field3 (Plucker a) (Plucker a) a a |
Instance details Defined in Linear.Plucker Methods _3 :: Lens (Plucker a) (Plucker a) a a Source #
Field3 (Quaternion a) (Quaternion a) a a |
Instance details Defined in Linear.Quaternion Methods _3 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field3 (V3 a) (V3 a) a a |
Instance details Defined in Linear.V3 Methods _3 :: Lens (V3 a) (V3 a) a a Source #
Field3 (V4 a) (V4 a) a a |
Instance details Defined in Linear.V4 Methods _3 :: Lens (V4 a) (V4 a) a a Source #
3 <= n => Field3 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _3 :: Lens (V n a) (V n a) a a Source #
Field3 (a, b, c) (a, b, c') c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c) (a, b, c') c c' Source #
Field3 (a, b, c, d) (a, b, c', d) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d) (a, b, c', d) c c' Source #
Field3 (a, b, c, d, e) (a, b, c', d, e) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e) (a, b, c', d, e) c c' Source #
Field3 (a, b, c, d, e, f) (a, b, c', d, e, f) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f) (a, b, c', d, e, f) c c' Source #
Field3 (a, b, c, d, e, f, g) (a, b, c', d, e, f, g) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g) (a, b, c', d, e, f, g) c c' Source #
Field3 (a, b, c, d, e, f, g, h) (a, b, c', d, e, f, g, h) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h) (a, b, c', d, e, f, g, h) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j) (a, b, c', d, e, f, g, h, i, j) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c', d, e, f, g, h, i, j) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c', d, e, f, g, h, i, j, kk) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c', d, e, f, g, h, i, j, kk) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c', d, e, f, g, h, i, j, kk, l) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c', d, e, f, g, h, i, j, kk, l) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c', d, e, f, g, h, i, j, kk, l, m) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c', d, e, f, g, h, i, j, kk, l, m) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) c c' Source #
Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) c c' |
Instance details Defined in Control.Lens.Tuple Methods _3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) c c' Source #

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

Provides access to the 2nd field of a tuple.

Minimal complete definition

Nothing

Methods

_2 :: Lens s t a b Source #

Access the 2nd field of a tuple.

    >>> _2 .~ "hello" $ (1,(),3,4)
    (1,"hello",3,4)

    >>> (1,2,3,4) & _2 *~ 3
    (1,6,3,4)

    >>> _2 print (1,2)
    2
    (1,())

    anyOf _2 :: (s -> Bool) -> (a, s) -> Bool
    traverse . _2 :: (Applicative f, Traversable t) => (a -> f b) -> t (s, a) -> f (t (s, b))
    foldMapOf (traverse . _2) :: (Traversable t, Monoid m) => (s -> m) -> t (b, s) -> m

#### Instances

Instances details

Field2 (Plucker a) (Plucker a) a a |
Instance details Defined in Linear.Plucker Methods _2 :: Lens (Plucker a) (Plucker a) a a Source #
Field2 (Quaternion a) (Quaternion a) a a |
Instance details Defined in Linear.Quaternion Methods _2 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field2 (V2 a) (V2 a) a a |
Instance details Defined in Linear.V2 Methods _2 :: Lens (V2 a) (V2 a) a a Source #
Field2 (V3 a) (V3 a) a a |
Instance details Defined in Linear.V3 Methods _2 :: Lens (V3 a) (V3 a) a a Source #
Field2 (V4 a) (V4 a) a a |
Instance details Defined in Linear.V4 Methods _2 :: Lens (V4 a) (V4 a) a a Source #
Field2 (Pair a b) (Pair a b') b b' | Since: lens-4.20
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (Pair a b) (Pair a b') b b' Source #

Field2 (a, b) (a, b') b b'

    _2 k ~(a,b) = (\b' -> (a,b')) <$> k b

Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b) (a, b') b b' Source #
2 <= n => Field2 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _2 :: Lens (V n a) (V n a) a a Source #
Field2 (a, b, c) (a, b', c) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c) (a, b', c) b b' Source #
Field2 (a, b, c, d) (a, b', c, d) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d) (a, b', c, d) b b' Source #
Field2 (Product f g a) (Product f g' a) (g a) (g' a) |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (Product f g a) (Product f g' a) (g a) (g' a) Source #
Field2 ((f :*: g) p) ((f :*: g') p) (g p) (g' p) |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens ((f :*: g) p) ((f :*: g') p) (g p) (g' p) Source #
Field2 (a, b, c, d, e) (a, b', c, d, e) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e) (a, b', c, d, e) b b' Source #
Field2 (a, b, c, d, e, f) (a, b', c, d, e, f) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f) (a, b', c, d, e, f) b b' Source #
Field2 (a, b, c, d, e, f, g) (a, b', c, d, e, f, g) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g) (a, b', c, d, e, f, g) b b' Source #
Field2 (a, b, c, d, e, f, g, h) (a, b', c, d, e, f, g, h) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h) (a, b', c, d, e, f, g, h) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j) (a, b', c, d, e, f, g, h, i, j) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b', c, d, e, f, g, h, i, j) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk) (a, b', c, d, e, f, g, h, i, j, kk) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b', c, d, e, f, g, h, i, j, kk) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b', c, d, e, f, g, h, i, j, kk, l) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b', c, d, e, f, g, h, i, j, kk, l) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b', c, d, e, f, g, h, i, j, kk, l, m) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b', c, d, e, f, g, h, i, j, kk, l, m) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) b b' Source #
Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) b b' |
Instance details Defined in Control.Lens.Tuple Methods _2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) b b' Source #

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

Provides access to 1st field of a tuple.

Minimal complete definition

Nothing

Methods

_1 :: Lens s t a b Source #

Access the 1st field of a tuple (and possibly change its type).

    >>> (1,2)^._1
    1

    >>> _1 .~ "hello" $ (1,2)
    ("hello",2)

    >>> (1,2) & _1 .~ "hello"
    ("hello",2)

    >>> _1 putStrLn ("hello","world")
    hello
    ((),"world")

This can also be used on larger tuples as well:

    >>> (1,2,3,4,5) & _1 +~ 41
    (42,2,3,4,5)

    _1 :: Lens (a,b) (a',b) a a'
    _1 :: Lens (a,b,c) (a',b,c) a a'
    _1 :: Lens (a,b,c,d) (a',b,c,d) a a'
    ...
    _1 :: Lens (a,b,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a'

#### Instances

Instances details

Field1 (Identity a) (Identity b) a b |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (Identity a) (Identity b) a b Source #
Field1 (Plucker a) (Plucker a) a a |
Instance details Defined in Linear.Plucker Methods _1 :: Lens (Plucker a) (Plucker a) a a Source #
Field1 (Quaternion a) (Quaternion a) a a |
Instance details Defined in Linear.Quaternion Methods _1 :: Lens (Quaternion a) (Quaternion a) a a Source #
Field1 (V1 a) (V1 b) a b |
Instance details Defined in Linear.V1 Methods _1 :: Lens (V1 a) (V1 b) a b Source #
Field1 (V2 a) (V2 a) a a |
Instance details Defined in Linear.V2 Methods _1 :: Lens (V2 a) (V2 a) a a Source #
Field1 (V3 a) (V3 a) a a |
Instance details Defined in Linear.V3 Methods _1 :: Lens (V3 a) (V3 a) a a Source #
Field1 (V4 a) (V4 a) a a |
Instance details Defined in Linear.V4 Methods _1 :: Lens (V4 a) (V4 a) a a Source #
Field1 (Pair a b) (Pair a' b) a a' | Since: lens-4.20
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (Pair a b) (Pair a' b) a a' Source #

Field1 (a, b) (a', b) a a'

    _1 k ~(a,b) = (\a' -> (a',b)) <$> k a

Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b) (a', b) a a' Source #
1 <= n => Field1 (V n a) (V n a) a a |
Instance details Defined in Linear.V Methods _1 :: Lens (V n a) (V n a) a a Source #
Field1 (a, b, c) (a', b, c) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c) (a', b, c) a a' Source #
Field1 (a, b, c, d) (a', b, c, d) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d) (a', b, c, d) a a' Source #
Field1 (Product f g a) (Product f' g a) (f a) (f' a) |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (Product f g a) (Product f' g a) (f a) (f' a) Source #
Field1 ((f :*: g) p) ((f' :*: g) p) (f p) (f' p) |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens ((f :*: g) p) ((f' :*: g) p) (f p) (f' p) Source #
Field1 (a, b, c, d, e) (a', b, c, d, e) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e) (a', b, c, d, e) a a' Source #
Field1 (a, b, c, d, e, f) (a', b, c, d, e, f) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f) (a', b, c, d, e, f) a a' Source #
Field1 (a, b, c, d, e, f, g) (a', b, c, d, e, f, g) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g) (a', b, c, d, e, f, g) a a' Source #
Field1 (a, b, c, d, e, f, g, h) (a', b, c, d, e, f, g, h) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h) (a', b, c, d, e, f, g, h) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j) (a', b, c, d, e, f, g, h, i, j) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j) (a', b, c, d, e, f, g, h, i, j) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk) (a', b, c, d, e, f, g, h, i, j, kk) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a', b, c, d, e, f, g, h, i, j, kk) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l) (a', b, c, d, e, f, g, h, i, j, kk, l) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a', b, c, d, e, f, g, h, i, j, kk, l) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a', b, c, d, e, f, g, h, i, j, kk, l, m) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a', b, c, d, e, f, g, h, i, j, kk, l, m) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) a a' Source #
Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) a a' |
Instance details Defined in Control.Lens.Tuple Methods _1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) a a' Source #

type Accessing (p :: Type -> Type -> Type) m s a = p a (Const m a) -> s -> Const m s Source #

This is a convenient alias used when consuming (indexed) getters and (indexed) folds in a highly general fashion.

type IndexedGetting i m s a = Indexed i a (Const m a) -> s -> Const m s Source #

Used to consume an `IndexedFold`.

class Suffixed t where Source #

Methods

suffixed :: t -> Prism' t t Source #

A `Prism` stripping a suffix from a sequence when used as a `Traversal`, or appending that suffix when run backwards:

    >>> "review" ^? suffixed "view"
    Just "re"

    >>> "review" ^? suffixed "tire"
    Nothing

    >>> suffixed ".o" # "hello"
    "hello.o"

#### Instances

Instances details

Suffixed ByteString |
Instance details Defined in Control.Lens.Prism Methods suffixed :: ByteString -> Prism' ByteString ByteString Source #
Suffixed ByteString |
Instance details Defined in Control.Lens.Prism Methods suffixed :: ByteString -> Prism' ByteString ByteString Source #
Suffixed Text |
Instance details Defined in Control.Lens.Prism Methods suffixed :: Text -> Prism' Text Text Source #
Suffixed Text |
Instance details Defined in Control.Lens.Prism Methods suffixed :: Text -> Prism' Text Text Source #
Eq a => Suffixed [a] |
Instance details Defined in Control.Lens.Prism Methods suffixed :: [a] -> Prism' [a] [a] Source #

class Prefixed t where Source #

Methods

prefixed :: t -> Prism' t t Source #

A `Prism` stripping a prefix from a sequence when used as a `Traversal`, or prepending that prefix when run backwards:

    >>> "preview" ^? prefixed "pre"
    Just "view"

    >>> "review" ^? prefixed "pre"
    Nothing

    >>> prefixed "pre" # "amble"
    "preamble"

#### Instances

Instances details

Prefixed ByteString |
Instance details Defined in Control.Lens.Prism Methods prefixed :: ByteString -> Prism' ByteString ByteString Source #
Prefixed ByteString |
Instance details Defined in Control.Lens.Prism Methods prefixed :: ByteString -> Prism' ByteString ByteString Source #
Prefixed Text |
Instance details Defined in Control.Lens.Prism Methods prefixed :: Text -> Prism' Text Text Source #
Prefixed Text |
Instance details Defined in Control.Lens.Prism Methods prefixed :: Text -> Prism' Text Text Source #
Eq a => Prefixed [a] |
Instance details Defined in Control.Lens.Prism Methods prefixed :: [a] -> Prism' [a] [a] Source #

type APrism' s a = APrism s s a a Source #

    type APrism' = Simple APrism

type APrism s t a b = Market a b a (Identity b) -> Market a b s (Identity t) Source #

If you see this in a signature for a function, the function is expecting a `Prism`.

class Ord k => TraverseMax k (m :: Type -> Type) | m -> k where Source #

Allows `IndexedTraversal` of the value at the largest index.

Methods

traverseMax :: IndexedTraversal' k (m v) v Source #

`IndexedTraversal` of the element at the largest index.

#### Instances

Instances details

TraverseMax Int IntMap |
Instance details Defined in Control.Lens.Traversal Methods traverseMax :: IndexedTraversal' Int (IntMap v) v Source #
Ord k => TraverseMax k (Map k) |
Instance details Defined in Control.Lens.Traversal Methods traverseMax :: IndexedTraversal' k (Map k v) v Source #

class Ord k => TraverseMin k (m :: Type -> Type) | m -> k where Source #

Allows `IndexedTraversal` the value at the smallest index.

Methods

traverseMin :: IndexedTraversal' k (m v) v Source #

`IndexedTraversal` of the element with the smallest index.

#### Instances

Instances details

TraverseMin Int IntMap |
Instance details Defined in Control.Lens.Traversal Methods traverseMin :: IndexedTraversal' Int (IntMap v) v Source #
Ord k => TraverseMin k (Map k) |
Instance details Defined in Control.Lens.Traversal Methods traverseMin :: IndexedTraversal' k (Map k v) v Source #

type Traversing1' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Traversing1 p f s s a a Source #

type Traversing' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Traversing p f s s a a Source #

    type Traversing' f = Simple (Traversing f)

type Traversing1 (p :: Type -> Type -> Type) (f :: Type -> Type) s t a b = Over p (BazaarT1 p f a b) s t a b Source #

type Traversing (p :: Type -> Type -> Type) (f :: Type -> Type) s t a b = Over p (BazaarT p f a b) s t a b Source #

When you see this as an argument to a function, it expects

- to be indexed if `p` is an instance of `Indexed` i,
- to be unindexed if `p` is `(->)`,
- a `Traversal` if `f` is `Applicative`,
- a `Getter` if `f` is only a `Functor` and `Contravariant`,
- a `Lens` if `f` is only a `Functor`,
- a `Fold` if `f` is `Applicative` and `Contravariant`.

type AnIndexedTraversal1' i s a = AnIndexedTraversal1 i s s a a Source #

    type AnIndexedTraversal1' = Simple (AnIndexedTraversal1 i)

type AnIndexedTraversal' i s a = AnIndexedTraversal i s s a a Source #

    type AnIndexedTraversal' = Simple (AnIndexedTraversal i)

type AnIndexedTraversal1 i s t a b = Over (Indexed i) (Bazaar1 (Indexed i) a b) s t a b Source #

When you see this as an argument to a function, it expects an `IndexedTraversal1`.

type AnIndexedTraversal i s t a b = Over (Indexed i) (Bazaar (Indexed i) a b) s t a b Source #

When you see this as an argument to a function, it expects an `IndexedTraversal`.

type ATraversal1' s a = ATraversal1 s s a a Source #

    type ATraversal1' = Simple ATraversal1

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

When you see this as an argument to a function, it expects a `Traversal1`.

type ATraversal' s a = ATraversal s s a a Source #

    type ATraversal' = Simple ATraversal

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

When you see this as an argument to a function, it expects a `Traversal`.

type ReifiedPrism' s a = ReifiedPrism s s a a Source #

    type ReifiedPrism' = Simple ReifiedPrism

newtype ReifiedPrism s t a b Source #

Reify a `Prism` so it can be stored safely in a container.

Constructors

Prism |

Fields

- runPrism :: Prism s t a b

type ReifiedIso' s a = ReifiedIso s s a a Source #

    type ReifiedIso' = Simple ReifiedIso

newtype ReifiedIso s t a b Source #

Reify an `Iso` so it can be stored safely in a container.

Constructors

Iso |

Fields

- runIso :: Iso s t a b

type ReifiedIndexedSetter' i s a = ReifiedIndexedSetter i s s a a Source #

    type ReifiedIndexedSetter' i = Simple (ReifiedIndexedSetter i)

newtype ReifiedIndexedSetter i s t a b Source #

Reify an `IndexedSetter` so it can be stored safely in a container.

Constructors

IndexedSetter |

Fields

- runIndexedSetter :: IndexedSetter i s t a b

type ReifiedSetter' s a = ReifiedSetter s s a a Source #

    type ReifiedSetter' = Simple ReifiedSetter

newtype ReifiedSetter s t a b Source #

Reify a `Setter` so it can be stored safely in a container.

Constructors

Setter |

Fields

- runSetter :: Setter s t a b

newtype ReifiedIndexedFold i s a Source #

Constructors

IndexedFold |

Fields

- runIndexedFold :: IndexedFold i s a

#### Instances

Instances details

Representable (ReifiedIndexedFold i) |
Instance details Defined in Control.Lens.Reified Associated Types type Rep (ReifiedIndexedFold i) :: Type -> Type Source # Methods tabulate :: (d -> Rep (ReifiedIndexedFold i) c) -> ReifiedIndexedFold i d c Source #
Strong (ReifiedIndexedFold i) |
Instance details Defined in Control.Lens.Reified Methods first' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (a, c) (b, c) Source # second' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (c, a) (c, b) Source #
Profunctor (ReifiedIndexedFold i) |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d Source #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c Source #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedIndexedFold i b c -> q a b -> ReifiedIndexedFold i a c Source #

Sieve (ReifiedIndexedFold i) (Compose [] ((,) i)) |
Instance details Defined in Control.Lens.Reified Methods sieve :: ReifiedIndexedFold i a b -> a -> Compose [] ((,) i) b Source #
Functor (ReifiedIndexedFold i s) |
Instance details Defined in Control.Lens.Reified Methods fmap :: (a -> b) -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s b Source # (<$) :: a -> ReifiedIndexedFold i s b -> ReifiedIndexedFold i s a Source #
Alt (ReifiedIndexedFold i s) |
Instance details Defined in Control.Lens.Reified Methods (<!>) :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a some :: Applicative (ReifiedIndexedFold i s) => ReifiedIndexedFold i s a -> ReifiedIndexedFold i s [a] many :: Applicative (ReifiedIndexedFold i s) => ReifiedIndexedFold i s a -> ReifiedIndexedFold i s [a]
Plus (ReifiedIndexedFold i s) |
Instance details Defined in Control.Lens.Reified Methods zero :: ReifiedIndexedFold i s a
Monoid (ReifiedIndexedFold i s a) |
Instance details Defined in Control.Lens.Reified Methods mempty :: ReifiedIndexedFold i s a Source # mappend :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a Source # mconcat :: [ReifiedIndexedFold i s a] -> ReifiedIndexedFold i s a Source #
Semigroup (ReifiedIndexedFold i s a) |
Instance details Defined in Control.Lens.Reified Methods (<>) :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a Source # sconcat :: NonEmpty (ReifiedIndexedFold i s a) -> ReifiedIndexedFold i s a Source # stimes :: Integral b => b -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a Source #
type Rep (ReifiedIndexedFold i) |
Instance details Defined in Control.Lens.Reified type Rep (ReifiedIndexedFold i) = Compose [] ((,) i)

newtype ReifiedFold s a Source #

Reify a `Fold` so it can be stored safely in a container.

This can also be useful for creatively combining folds as ``ReifiedFold` s` is isomorphic to `ReaderT s []` and provides similar instances.

    >>> ("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
    [("world","hello"),("world","world")]

Constructors

Fold |

Fields

- runFold :: Fold s a

#### Instances

Instances details

Arrow ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods arr :: (b -> c) -> ReifiedFold b c Source # first :: ReifiedFold b c -> ReifiedFold (b, d) (c, d) Source # second :: ReifiedFold b c -> ReifiedFold (d, b) (d, c) Source # (***) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (b, b') (c, c') Source # (&&&) :: ReifiedFold b c -> ReifiedFold b c' -> ReifiedFold b (c, c') Source #
ArrowApply ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods app :: ReifiedFold (ReifiedFold b c, b) c Source #
ArrowChoice ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods left :: ReifiedFold b c -> ReifiedFold (Either b d) (Either c d) Source # right :: ReifiedFold b c -> ReifiedFold (Either d b) (Either d c) Source # (+++) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (Either b b') (Either c c') Source # (|||) :: ReifiedFold b d -> ReifiedFold c d -> ReifiedFold (Either b c) d Source #
Choice ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) Source # right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) Source #
Representable ReifiedFold |
Instance details Defined in Control.Lens.Reified Associated Types type Rep ReifiedFold :: Type -> Type Source # Methods tabulate :: (d -> Rep ReifiedFold c) -> ReifiedFold d c Source #
Strong ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods first' :: ReifiedFold a b -> ReifiedFold (a, c) (b, c) Source # second' :: ReifiedFold a b -> ReifiedFold (c, a) (c, b) Source #
Profunctor ReifiedFold |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d Source #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c Source #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedFold a b -> ReifiedFold a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedFold b c -> q a b -> ReifiedFold a c Source #

Category ReifiedFold |
Instance details Defined in Control.Lens.Reified Methods id :: forall (a :: k). ReifiedFold a a Source # (.) :: forall (b :: k) (c :: k) (a :: k). ReifiedFold b c -> ReifiedFold a b -> ReifiedFold a c Source #
Sieve ReifiedFold [] |
Instance details Defined in Control.Lens.Reified Methods sieve :: ReifiedFold a b -> a -> [b] Source #
MonadReader s (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods ask :: ReifiedFold s s Source # local :: (s -> s) -> ReifiedFold s a -> ReifiedFold s a Source # reader :: (s -> a) -> ReifiedFold s a Source #
Alternative (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods empty :: ReifiedFold s a Source # (<|>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a Source # some :: ReifiedFold s a -> ReifiedFold s [a] Source # many :: ReifiedFold s a -> ReifiedFold s [a] Source #
Applicative (ReifiedFold s) |

Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedFold s a Source #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b Source #

liftA2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c Source #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b Source #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a Source #

Functor (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b Source # (<$) :: a -> ReifiedFold s b -> ReifiedFold s a Source #
Monad (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods (>>=) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b Source # (>>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b Source # return :: a -> ReifiedFold s a Source #
MonadPlus (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods mzero :: ReifiedFold s a Source # mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a Source #
Alt (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods (<!>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a some :: Applicative (ReifiedFold s) => ReifiedFold s a -> ReifiedFold s [a] many :: Applicative (ReifiedFold s) => ReifiedFold s a -> ReifiedFold s [a]
Apply (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods (<.>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b (.>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b (<.) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a liftF2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c
Bind (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods (>>-) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b join :: ReifiedFold s (ReifiedFold s a) -> ReifiedFold s a
Plus (ReifiedFold s) |
Instance details Defined in Control.Lens.Reified Methods zero :: ReifiedFold s a
Monoid (ReifiedFold s a) |
Instance details Defined in Control.Lens.Reified Methods mempty :: ReifiedFold s a Source # mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a Source # mconcat :: [ReifiedFold s a] -> ReifiedFold s a Source #
Semigroup (ReifiedFold s a) |
Instance details Defined in Control.Lens.Reified Methods (<>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a Source # sconcat :: NonEmpty (ReifiedFold s a) -> ReifiedFold s a Source # stimes :: Integral b => b -> ReifiedFold s a -> ReifiedFold s a Source #
type Rep ReifiedFold |
Instance details Defined in Control.Lens.Reified type Rep ReifiedFold = []

newtype ReifiedIndexedGetter i s a Source #

Reify an `IndexedGetter` so it can be stored safely in a container.

Constructors

IndexedGetter |

Fields

- runIndexedGetter :: IndexedGetter i s a

#### Instances

Instances details

Representable (ReifiedIndexedGetter i) |
Instance details Defined in Control.Lens.Reified Associated Types type Rep (ReifiedIndexedGetter i) :: Type -> Type Source # Methods tabulate :: (d -> Rep (ReifiedIndexedGetter i) c) -> ReifiedIndexedGetter i d c Source #
Strong (ReifiedIndexedGetter i) |
Instance details Defined in Control.Lens.Reified Methods first' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (a, c) (b, c) Source # second' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (c, a) (c, b) Source #
Profunctor (ReifiedIndexedGetter i) |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d Source #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c Source #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedIndexedGetter i b c -> q a b -> ReifiedIndexedGetter i a c Source #

Sieve (ReifiedIndexedGetter i) ((,) i) |
Instance details Defined in Control.Lens.Reified Methods sieve :: ReifiedIndexedGetter i a b -> a -> (i, b) Source #
Functor (ReifiedIndexedGetter i s) |
Instance details Defined in Control.Lens.Reified Methods fmap :: (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b Source # (<$) :: a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a Source #
Semigroup i => Apply (ReifiedIndexedGetter i s) |

Instance details

Defined in Control.Lens.Reified

Methods

(<.>) :: ReifiedIndexedGetter i s (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b

(.>) :: ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s b

(<.) :: ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a

liftF2 :: (a -> b -> c) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s c

type Rep (ReifiedIndexedGetter i) |
Instance details Defined in Control.Lens.Reified type Rep (ReifiedIndexedGetter i) = (,) i

newtype ReifiedGetter s a Source #

Reify a `Getter` so it can be stored safely in a container.

This can also be useful when combining getters in novel ways, as `ReifiedGetter` is isomorphic to `(->)` and provides similar instances.

    >>> ("hello","world","!!!")^.runGetter ((,) <$> Getter _2 <*> Getter (_1.to length))
    ("world",5)

Constructors

Getter |

Fields

- runGetter :: Getter s a

#### Instances

Instances details

Arrow ReifiedGetter |

Instance details

Defined in Control.Lens.Reified

Methods

arr :: (b -> c) -> ReifiedGetter b c Source #

first :: ReifiedGetter b c -> ReifiedGetter (b, d) (c, d) Source #

second :: ReifiedGetter b c -> ReifiedGetter (d, b) (d, c) Source #

(***) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (b, b') (c, c') Source #

(&&&) :: ReifiedGetter b c -> ReifiedGetter b c' -> ReifiedGetter b (c, c') Source #

ArrowApply ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods app :: ReifiedGetter (ReifiedGetter b c, b) c Source #
ArrowChoice ReifiedGetter |

Instance details

Defined in Control.Lens.Reified

Methods

left :: ReifiedGetter b c -> ReifiedGetter (Either b d) (Either c d) Source #

right :: ReifiedGetter b c -> ReifiedGetter (Either d b) (Either d c) Source #

(+++) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (Either b b') (Either c c') Source #

(|||) :: ReifiedGetter b d -> ReifiedGetter c d -> ReifiedGetter (Either b c) d Source #

ArrowLoop ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods loop :: ReifiedGetter (b, d) (c, d) -> ReifiedGetter b c Source #
Conjoined ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) Source # conjoined :: (ReifiedGetter ~ (->) => q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r Source #
Choice ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) Source # right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) Source #
Closed ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods closed :: ReifiedGetter a b -> ReifiedGetter (x -> a) (x -> b) Source #
Corepresentable ReifiedGetter |
Instance details Defined in Control.Lens.Reified Associated Types type Corep ReifiedGetter :: Type -> Type Source # Methods cotabulate :: (Corep ReifiedGetter d -> c) -> ReifiedGetter d c Source #
Representable ReifiedGetter |
Instance details Defined in Control.Lens.Reified Associated Types type Rep ReifiedGetter :: Type -> Type Source # Methods tabulate :: (d -> Rep ReifiedGetter c) -> ReifiedGetter d c Source #
Costrong ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods unfirst :: ReifiedGetter (a, d) (b, d) -> ReifiedGetter a b Source # unsecond :: ReifiedGetter (d, a) (d, b) -> ReifiedGetter a b Source #
Strong ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods first' :: ReifiedGetter a b -> ReifiedGetter (a, c) (b, c) Source # second' :: ReifiedGetter a b -> ReifiedGetter (c, a) (c, b) Source #
Profunctor ReifiedGetter |

Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d Source #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c Source #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedGetter a b -> ReifiedGetter a c Source #

(.#) :: forall a b c q. Coercible b a => ReifiedGetter b c -> q a b -> ReifiedGetter a c Source #

Category ReifiedGetter |
Instance details Defined in Control.Lens.Reified Methods id :: forall (a :: k). ReifiedGetter a a Source # (.) :: forall (b :: k) (c :: k) (a :: k). ReifiedGetter b c -> ReifiedGetter a b -> ReifiedGetter a c Source #
Cosieve ReifiedGetter Identity |
Instance details Defined in Control.Lens.Reified Methods cosieve :: ReifiedGetter a b -> Identity a -> b Source #
Sieve ReifiedGetter Identity |
Instance details Defined in Control.Lens.Reified Methods sieve :: ReifiedGetter a b -> a -> Identity b Source #
MonadReader s (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods ask :: ReifiedGetter s s Source # local :: (s -> s) -> ReifiedGetter s a -> ReifiedGetter s a Source # reader :: (s -> a) -> ReifiedGetter s a Source #
Applicative (ReifiedGetter s) |

Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedGetter s a Source #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b Source #

liftA2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c Source #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b Source #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a Source #

Functor (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods fmap :: (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b Source # (<$) :: a -> ReifiedGetter s b -> ReifiedGetter s a Source #
Monad (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods (>>=) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b Source # (>>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b Source # return :: a -> ReifiedGetter s a Source #
Monoid s => Comonad (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods extract :: ReifiedGetter s a -> a duplicate :: ReifiedGetter s a -> ReifiedGetter s (ReifiedGetter s a) extend :: (ReifiedGetter s a -> b) -> ReifiedGetter s a -> ReifiedGetter s b
Monoid s => ComonadApply (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods (<@>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b (@>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b (<@) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a
Distributive (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods distribute :: Functor f => f (ReifiedGetter s a) -> ReifiedGetter s (f a) Source # collect :: Functor f => (a -> ReifiedGetter s b) -> f a -> ReifiedGetter s (f b) Source # distributeM :: Monad m => m (ReifiedGetter s a) -> ReifiedGetter s (m a) Source # collectM :: Monad m => (a -> ReifiedGetter s b) -> m a -> ReifiedGetter s (m b) Source #
Apply (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods (<.>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b (.>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b (<.) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a liftF2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c
Bind (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods (>>-) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b join :: ReifiedGetter s (ReifiedGetter s a) -> ReifiedGetter s a
Semigroup s => Extend (ReifiedGetter s) |
Instance details Defined in Control.Lens.Reified Methods duplicated :: ReifiedGetter s a -> ReifiedGetter s (ReifiedGetter s a) extended :: (ReifiedGetter s a -> b) -> ReifiedGetter s a -> ReifiedGetter s b
type Corep ReifiedGetter |
Instance details Defined in Control.Lens.Reified type Corep ReifiedGetter = Identity
type Rep ReifiedGetter |
Instance details Defined in Control.Lens.Reified type Rep ReifiedGetter = Identity

type ReifiedTraversal' s a = ReifiedTraversal s s a a Source #

    type ReifiedTraversal' = Simple ReifiedTraversal

type ReifiedIndexedTraversal' i s a = ReifiedIndexedTraversal i s s a a Source #

    type ReifiedIndexedTraversal' i = Simple (ReifiedIndexedTraversal i)

newtype ReifiedIndexedTraversal i s t a b Source #

Reify an `IndexedTraversal` so it can be stored safely in a container.

Constructors

IndexedTraversal |

Fields

- runIndexedTraversal :: IndexedTraversal i s t a b

type ReifiedIndexedLens' i s a = ReifiedIndexedLens i s s a a Source #

    type ReifiedIndexedLens' i = Simple (ReifiedIndexedLens i)

newtype ReifiedIndexedLens i s t a b Source #

Reify an `IndexedLens` so it can be stored safely in a container.

Constructors

IndexedLens |

Fields

- runIndexedLens :: IndexedLens i s t a b

type ReifiedLens' s a = ReifiedLens s s a a Source #

    type ReifiedLens' = Simple ReifiedLens

newtype ReifiedLens s t a b Source #

Reify a `Lens` so it can be stored safely in a container.

Constructors

Lens |

Fields

- runLens :: Lens s t a b

type AnEquality' (s :: k) (a :: k) = AnEquality s s a a Source #

A `Simple` `AnEquality`.

type AnEquality (s :: k) (t :: k1) (a :: k) (b :: k2) = Identical a (Proxy b) a (Proxy b) -> Identical a (Proxy b) s (Proxy t) Source #

When you see this as an argument to a function, it expects an `Equality`.

data Identical (a :: k) (b :: k1) (s :: k) (t :: k1) where Source #

Provides witness that `(s ~ a, b ~ t)` holds.

Constructors

Identical :: forall {k} {k1} (a :: k) (b :: k1). Identical a b a b |

type AnIso' s a = AnIso s s a a Source #

A `Simple` `AnIso`.

type AnIso s t a b = Exchange a b a (Identity b) -> Exchange a b s (Identity t) Source #

When you see this as an argument to a function, it expects an `Iso`.

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

This class provides a way to attach or detach elements on the right side of a structure in a flexible manner.

Methods

_Snoc :: Prism s t (s, a) (t, b) Source #

    _Snoc :: Prism [a] [b] ([a], a) ([b], b)
    _Snoc :: Prism (Seq a) (Seq b) (Seq a, a) (Seq b, b)
    _Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b)
    _Snoc :: Prism' String (String, Char)
    _Snoc :: Prism' Text (Text, Char)
    _Snoc :: Prism' ByteString (ByteString, Word8)

#### Instances

Instances details

Snoc ByteString ByteString Word8 Word8 |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism ByteString ByteString (ByteString, Word8) (ByteString, Word8) Source #
Snoc ByteString ByteString Word8 Word8 |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism ByteString ByteString (ByteString, Word8) (ByteString, Word8) Source #
Snoc Text Text Char Char |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism Text Text (Text, Char) (Text, Char) Source #
Snoc Text Text Char Char |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism Text Text (Text, Char) (Text, Char) Source #
Snoc (ZipList a) (ZipList b) a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism (ZipList a) (ZipList b) (ZipList a, a) (ZipList b, b) Source #
Snoc (Seq a) (Seq b) a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism (Seq a) (Seq b) (Seq a, a) (Seq b, b) Source #
Snoc (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) Source #
(Prim a, Prim b) => Snoc (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) Source #
(Storable a, Storable b) => Snoc (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) Source #
(Unbox a, Unbox b) => Snoc (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) Source #
Snoc [a] [b] a b |
Instance details Defined in Control.Lens.Cons Methods _Snoc :: Prism [a] [b] ([a], a) ([b], b) Source #
(Measured m a, Measured n b) => Snoc (FingerTree m a) (FingerTree n b) a b Source # |
Instance details Defined in Diagrams.Trail Methods _Snoc :: Prism (FingerTree m a) (FingerTree n b) (FingerTree m a, a) (FingerTree n b, b) Source #
Snoc (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) Source # |
Instance details Defined in Diagrams.Path Methods _Snoc :: Prism (Path v n) (Path v' n') (Path v n, Located (Trail v n)) (Path v' n', Located (Trail v' n')) Source #
(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') Source # |
Instance details Defined in Diagrams.Trail Methods _Snoc :: Prism (SegTree v n) (SegTree u n') (SegTree v n, Segment Closed v n) (SegTree u n', Segment Closed u n') Source #
(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') Source # |
Instance details Defined in Diagrams.Trail Methods _Snoc :: Prism (Trail' Line v n) (Trail' Line u n') (Trail' Line v n, Segment Closed v n) (Trail' Line u n', Segment Closed u n') Source #

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

This class provides a way to attach or detach elements on the left side of a structure in a flexible manner.

Methods

_Cons :: Prism s t (a, s) (b, t) Source #

    _Cons :: Prism [a] [b] (a, [a]) (b, [b])
    _Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b)
    _Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b)
    _Cons :: Prism' String (Char, String)
    _Cons :: Prism' Text (Char, Text)
    _Cons :: Prism' ByteString (Word8, ByteString)

#### Instances

Instances details

Cons ByteString ByteString Word8 Word8 |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism ByteString ByteString (Word8, ByteString) (Word8, ByteString) Source #
Cons ByteString ByteString Word8 Word8 |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism ByteString ByteString (Word8, ByteString) (Word8, ByteString) Source #
Cons Text Text Char Char |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism Text Text (Char, Text) (Char, Text) Source #
Cons Text Text Char Char |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism Text Text (Char, Text) (Char, Text) Source #
Cons (ZipList a) (ZipList b) a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism (ZipList a) (ZipList b) (a, ZipList a) (b, ZipList b) Source #
Cons (Seq a) (Seq b) a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b) Source #
Cons (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) Source #
(Prim a, Prim b) => Cons (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) Source #
(Storable a, Storable b) => Cons (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) Source #
(Unbox a, Unbox b) => Cons (Vector a) (Vector b) a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) Source #
Cons [a] [b] a b |
Instance details Defined in Control.Lens.Cons Methods _Cons :: Prism [a] [b] (a, [a]) (b, [b]) Source #
(Measured m a, Measured n b) => Cons (FingerTree m a) (FingerTree n b) a b Source # |
Instance details Defined in Diagrams.Trail Methods _Cons :: Prism (FingerTree m a) (FingerTree n b) (a, FingerTree m a) (b, FingerTree n b) Source #
Cons (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) Source # |
Instance details Defined in Diagrams.Path Methods _Cons :: Prism (Path v n) (Path v' n') (Located (Trail v n), Path v n) (Located (Trail v' n'), Path v' n') Source #
(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') Source # |
Instance details Defined in Diagrams.Trail Methods _Cons :: Prism (SegTree v n) (SegTree u n') (Segment Closed v n, SegTree v n) (Segment Closed u n', SegTree u n') Source #
(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') Source # |
Instance details Defined in Diagrams.Trail Methods _Cons :: Prism (Trail' Line v n) (Trail' Line u n') (Segment Closed v n, Trail' Line v n) (Segment Closed u n', Trail' Line u n') Source #

class (Rewrapped s t, Rewrapped t s) => Rewrapping s t Source #

#### Instances

Instances details

(Rewrapped s t, Rewrapped t s) => Rewrapping s t |
Instance details Defined in Control.Lens.Wrapped

class Wrapped s => Rewrapped s t Source #

#### Instances

Instances details

t ~ NoMethodError => Rewrapped NoMethodError t |
Instance details Defined in Control.Lens.Wrapped
t ~ PatternMatchFail => Rewrapped PatternMatchFail t |
Instance details Defined in Control.Lens.Wrapped
t ~ RecConError => Rewrapped RecConError t |
Instance details Defined in Control.Lens.Wrapped
t ~ RecSelError => Rewrapped RecSelError t |
Instance details Defined in Control.Lens.Wrapped
t ~ RecUpdError => Rewrapped RecUpdError t |
Instance details Defined in Control.Lens.Wrapped
t ~ TypeError => Rewrapped TypeError t |
Instance details Defined in Control.Lens.Wrapped
t ~ All => Rewrapped All t |
Instance details Defined in Control.Lens.Wrapped
t ~ Any => Rewrapped Any t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped Errno t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CBool t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CChar t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CClock t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CDouble t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CFloat t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CInt t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CIntMax t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CIntPtr t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CLLong t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CLong t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CPtrdiff t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CSChar t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CSUSeconds t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CShort t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CSigAtomic t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CSize t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CTime t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUChar t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUInt t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUIntMax t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUIntPtr t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CULLong t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CULong t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUSeconds t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUShort t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CWchar t |
Instance details Defined in Control.Lens.Wrapped
t ~ ErrorCall => Rewrapped ErrorCall t |
Instance details Defined in Control.Lens.Wrapped
t ~ AssertionFailed => Rewrapped AssertionFailed t |
Instance details Defined in Control.Lens.Wrapped
t ~ CompactionFailed => Rewrapped CompactionFailed t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CBlkCnt t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CBlkSize t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CCc t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CClockId t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CDev t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CFsBlkCnt t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CFsFilCnt t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CGid t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CId t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CIno t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CKey t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CMode t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CNlink t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped COff t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CPid t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CRLim t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CSpeed t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CSsize t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CTcflag t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CTimer t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped CUid t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped Fd t |
Instance details Defined in Control.Lens.Wrapped
t ~ IntSet => Rewrapped IntSet t | Use ``_Wrapping` `fromList``. unwrapping returns a sorted list.
Instance details Defined in Control.Lens.Wrapped
Rewrapped Name Name |
Instance details Defined in Diagrams.Core.Names
Rewrapped SegCount SegCount Source # |
Instance details Defined in Diagrams.Segment
Active a1 ~ t => Rewrapped (Active a2) t |
Instance details Defined in Data.Active
Duration n1 ~ t => Rewrapped (Duration n2) t |
Instance details Defined in Data.Active
Time n1 ~ t => Rewrapped (Time n2) t |
Instance details Defined in Data.Active
t ~ ZipList b => Rewrapped (ZipList a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Comparison b => Rewrapped (Comparison a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Equivalence b => Rewrapped (Equivalence a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Predicate b => Rewrapped (Predicate a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Identity b => Rewrapped (Identity a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ First b => Rewrapped (First a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Last b => Rewrapped (Last a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Down b => Rewrapped (Down a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ First b => Rewrapped (First a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Last b => Rewrapped (Last a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Max b => Rewrapped (Max a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Min b => Rewrapped (Min a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WrappedMonoid b => Rewrapped (WrappedMonoid a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Dual b => Rewrapped (Dual a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Endo b => Rewrapped (Endo a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Product b => Rewrapped (Product a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Sum b => Rewrapped (Sum a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Par1 p' => Rewrapped (Par1 p) t |
Instance details Defined in Control.Lens.Wrapped
t ~ IntMap a' => Rewrapped (IntMap a) t | Use ``_Wrapping` `fromList``. unwrapping returns a sorted list.
Instance details Defined in Control.Lens.Wrapped
t ~ Seq a' => Rewrapped (Seq a) t |
Instance details Defined in Control.Lens.Wrapped
(t ~ Set a', Ord a) => Rewrapped (Set a) t | Use ``_Wrapping` `fromList``. unwrapping returns a sorted list.
Instance details Defined in Control.Lens.Wrapped
Clip n1 ~ t => Rewrapped (Clip n2) t Source # |
Instance details Defined in Diagrams.TwoD.Path
(t ~ HashSet a', Hashable a, Eq a) => Rewrapped (HashSet a) t | Use ``_Wrapping` `fromList``. Unwrapping returns some permutation of the list.
Instance details Defined in Control.Lens.Wrapped
t ~ Vector a' => Rewrapped (Vector a) t |
Instance details Defined in Control.Lens.Wrapped
(Prim a, t ~ Vector a') => Rewrapped (Vector a) t |
Instance details Defined in Control.Lens.Wrapped
(Storable a, t ~ Vector a') => Rewrapped (Vector a) t |
Instance details Defined in Control.Lens.Wrapped
(Unbox a, t ~ Vector a') => Rewrapped (Vector a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ NonEmpty b => Rewrapped (NonEmpty a) t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped (TransInv t) (TransInv t') |
Instance details Defined in Diagrams.Core.Transform
Rewrapped (ArcLength n) (ArcLength n') Source # |
Instance details Defined in Diagrams.Segment
t ~ WrappedMonad m' a' => Rewrapped (WrappedMonad m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ArrowMonad m' a' => Rewrapped (ArrowMonad m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Op a' b' => Rewrapped (Op a b) t |
Instance details Defined in Control.Lens.Wrapped
(t ~ Map k' a', Ord k) => Rewrapped (Map k a) t | Use ``_Wrapping` `fromList``. unwrapping returns a sorted list.
Instance details Defined in Control.Lens.Wrapped
t ~ CatchT m' a' => Rewrapped (CatchT m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Alt f' a' => Rewrapped (Alt f a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ CoiterT w' a' => Rewrapped (CoiterT w a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ IterT m' a' => Rewrapped (IterT m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Point g b => Rewrapped (Point f a) t |
Instance details Defined in Linear.Affine
t ~ MaybeApply f' a' => Rewrapped (MaybeApply f a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WrappedApplicative f' a' => Rewrapped (WrappedApplicative f a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ListT n b => Rewrapped (ListT m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ MaybeT n b => Rewrapped (MaybeT m a) t |
Instance details Defined in Control.Lens.Wrapped
(t ~ HashMap k' a', Hashable k, Eq k) => Rewrapped (HashMap k a) t | Use ``_Wrapping` `fromList``. Unwrapping returns some permutation of the list.
Instance details Defined in Control.Lens.Wrapped
Rewrapped (Envelope v n) (Envelope v' n') |
Instance details Defined in Diagrams.Core.Envelope
Rewrapped (Style v n) (Style v' n') |
Instance details Defined in Diagrams.Core.Style
Rewrapped (Trace v n) (Trace v' n') |
Instance details Defined in Diagrams.Core.Trace
Rewrapped (Path v n) (Path v' n') Source # |
Instance details Defined in Diagrams.Path
Rewrapped (TotalOffset v n) (TotalOffset v' n') Source # |
Instance details Defined in Diagrams.Segment
Rewrapped (SegTree v n) (SegTree v' n') Source # |
Instance details Defined in Diagrams.Trail
Rewrapped (Trail v n) (Trail v' n') Source # |
Instance details Defined in Diagrams.Trail
t ~ WrappedArrow a' b' c' => Rewrapped (WrappedArrow a b c) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Kleisli m' a' b' => Rewrapped (Kleisli m a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Const a' x' => Rewrapped (Const a x) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Ap g b => Rewrapped (Ap f a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Alt g b => Rewrapped (Alt f a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Rec1 f' p' => Rewrapped (Rec1 f p) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Fix p' a' => Rewrapped (Fix p a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Join p' a' => Rewrapped (Join p a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ TracedT m' w' a' => Rewrapped (TracedT m w a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Compose f' g' a' => Rewrapped (Compose f g a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ComposeCF f' g' a' => Rewrapped (ComposeCF f g a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ComposeFC f' g' a' => Rewrapped (ComposeFC f g a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ApT f' g' a' => Rewrapped (ApT f g a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ CofreeT f' w' a' => Rewrapped (CofreeT f w a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ FreeT f' m' a' => Rewrapped (FreeT f m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Static f' a' b' => Rewrapped (Static f a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Tagged s' a' => Rewrapped (Tagged s a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Backwards g b => Rewrapped (Backwards f a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ErrorT e' m' a' => Rewrapped (ErrorT e m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ExceptT e' m' a' => Rewrapped (ExceptT e m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ IdentityT n b => Rewrapped (IdentityT m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ReaderT s n b => Rewrapped (ReaderT r m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ StateT s' m' a' => Rewrapped (StateT s m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ StateT s' m' a' => Rewrapped (StateT s m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WriterT w' m' a' => Rewrapped (WriterT w m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WriterT w' m' a' => Rewrapped (WriterT w m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Constant a' b' => Rewrapped (Constant a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Reverse g b => Rewrapped (Reverse f a) t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped (Query v a m) (Query v' a' m') |
Instance details Defined in Diagrams.Core.Query
Rewrapped (Trail' Line v n) (Trail' Line v' n') Source # |
Instance details Defined in Diagrams.Trail
t ~ K1 i' c' p' => Rewrapped (K1 i c p) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Costar f' d' c' => Rewrapped (Costar f d c) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Forget r' a' b' => Rewrapped (Forget r a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Star f' d' c' => Rewrapped (Star f d c) t |
Instance details Defined in Control.Lens.Wrapped
t ~ ContT r' m' a' => Rewrapped (ContT r m a) t |
Instance details Defined in Control.Lens.Wrapped
Rewrapped (QDiagram b v n m) (QDiagram b' v' n' m') |
Instance details Defined in Diagrams.Core.Types
Rewrapped (SubMap b v n m) (SubMap b' v' n' m') |
Instance details Defined in Diagrams.Core.Types
t ~ Compose f' g' a' => Rewrapped (Compose f g a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ (f' :.: g') p' => Rewrapped ((f :.: g) p) t |
Instance details Defined in Control.Lens.Wrapped
t ~ M1 i' c' f' p' => Rewrapped (M1 i c f p) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Clown f' a' b' => Rewrapped (Clown f a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Flip p' a' b' => Rewrapped (Flip p a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Joker g' a' b' => Rewrapped (Joker g a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WrappedBifunctor p' a' b' => Rewrapped (WrappedBifunctor p a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WrappedArrow p' a' b' => Rewrapped (WrappedArrow p a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Semi m' a' b' => Rewrapped (Semi m a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ WrappedCategory k' a' b' => Rewrapped (WrappedCategory k6 a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Dual k' a' b' => Rewrapped (Dual k6 a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ RWST r' w' s' m' a' => Rewrapped (RWST r w s m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ RWST r' w' s' m' a' => Rewrapped (RWST r w s m a) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Tannen f' p' a' b' => Rewrapped (Tannen f p a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Cayley f' p' a' b' => Rewrapped (Cayley f p a b) t |
Instance details Defined in Control.Lens.Wrapped
t ~ Biff p' f' g' a' b' => Rewrapped (Biff p f g a b) t |
Instance details Defined in Control.Lens.Wrapped

type family Unwrapped s Source #

#### Instances

Instances details

type Unwrapped NoMethodError |
Instance details Defined in Control.Lens.Wrapped type Unwrapped NoMethodError = String
type Unwrapped PatternMatchFail |
Instance details Defined in Control.Lens.Wrapped type Unwrapped PatternMatchFail = String
type Unwrapped RecConError |
Instance details Defined in Control.Lens.Wrapped type Unwrapped RecConError = String
type Unwrapped RecSelError |
Instance details Defined in Control.Lens.Wrapped type Unwrapped RecSelError = String
type Unwrapped RecUpdError |
Instance details Defined in Control.Lens.Wrapped type Unwrapped RecUpdError = String
type Unwrapped TypeError |
Instance details Defined in Control.Lens.Wrapped type Unwrapped TypeError = String
type Unwrapped All |
Instance details Defined in Control.Lens.Wrapped type Unwrapped All = Bool
type Unwrapped Any |
Instance details Defined in Control.Lens.Wrapped type Unwrapped Any = Bool
type Unwrapped Errno |
Instance details Defined in Control.Lens.Wrapped type Unwrapped Errno = CInt
type Unwrapped CBool |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CBool = Word8
type Unwrapped CChar |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CChar = Int8
type Unwrapped CClock |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CClock = Int64
type Unwrapped CDouble |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CDouble = Double
type Unwrapped CFloat |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CFloat = Float
type Unwrapped CInt |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CInt = Int32
type Unwrapped CIntMax |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CIntMax = Int64
type Unwrapped CIntPtr |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CIntPtr = Int64
type Unwrapped CLLong |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CLLong = Int64
type Unwrapped CLong |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CLong = Int64
type Unwrapped CPtrdiff |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CPtrdiff = Int64
type Unwrapped CSChar |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CSChar = Int8
type Unwrapped CSUSeconds |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CSUSeconds = Int64
type Unwrapped CShort |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CShort = Int16
type Unwrapped CSigAtomic |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CSigAtomic = Int32
type Unwrapped CSize |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CSize = Word64
type Unwrapped CTime |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CTime = Int64
type Unwrapped CUChar |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUChar = Word8
type Unwrapped CUInt |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUInt = Word32
type Unwrapped CUIntMax |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUIntMax = Word64
type Unwrapped CUIntPtr |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUIntPtr = Word64
type Unwrapped CULLong |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CULLong = Word64
type Unwrapped CULong |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CULong = Word64
type Unwrapped CUSeconds |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUSeconds = Word32
type Unwrapped CUShort |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUShort = Word16
type Unwrapped CWchar |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CWchar = Int32
type Unwrapped ErrorCall |
Instance details Defined in Control.Lens.Wrapped type Unwrapped ErrorCall = String
type Unwrapped AssertionFailed |
Instance details Defined in Control.Lens.Wrapped type Unwrapped AssertionFailed = String
type Unwrapped CompactionFailed |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CompactionFailed = String
type Unwrapped CBlkCnt |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CBlkCnt = Int64
type Unwrapped CBlkSize |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CBlkSize = Int64
type Unwrapped CCc |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CCc = Word8
type Unwrapped CClockId |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CClockId = Int32
type Unwrapped CDev |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CDev = Word64
type Unwrapped CFsBlkCnt |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CFsBlkCnt = Word64
type Unwrapped CFsFilCnt |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CFsFilCnt = Word64
type Unwrapped CGid |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CGid = Word32
type Unwrapped CId |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CId = Word32
type Unwrapped CIno |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CIno = Word64
type Unwrapped CKey |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CKey = Int32
type Unwrapped CMode |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CMode = Word32
type Unwrapped CNlink |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CNlink = Word64
type Unwrapped COff |
Instance details Defined in Control.Lens.Wrapped type Unwrapped COff = Int64
type Unwrapped CPid |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CPid = Int32
type Unwrapped CRLim |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CRLim = Word64
type Unwrapped CSpeed |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CSpeed = Word32
type Unwrapped CSsize |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CSsize = Int64
type Unwrapped CTcflag |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CTcflag = Word32
type Unwrapped CTimer |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CTimer = CUIntPtr
type Unwrapped CUid |
Instance details Defined in Control.Lens.Wrapped type Unwrapped CUid = Word32
type Unwrapped Fd |
Instance details Defined in Control.Lens.Wrapped type Unwrapped Fd = CInt
type Unwrapped IntSet |
Instance details Defined in Control.Lens.Wrapped type Unwrapped IntSet = [Int]
type Unwrapped Name |
Instance details Defined in Diagrams.Core.Names type Unwrapped Name = [AName]
type Unwrapped SegCount Source # |
Instance details Defined in Diagrams.Segment type Unwrapped SegCount = Sum Int
type Unwrapped (Active a) |
Instance details Defined in Data.Active type Unwrapped (Active a) = MaybeApply Dynamic a
type Unwrapped (Duration n) |
Instance details Defined in Data.Active type Unwrapped (Duration n) = n
type Unwrapped (Time n) |
Instance details Defined in Data.Active type Unwrapped (Time n) = n
type Unwrapped (ZipList a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ZipList a) = [a]
type Unwrapped (Comparison a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Comparison a) = a -> a -> Ordering
type Unwrapped (Equivalence a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Equivalence a) = a -> a -> Bool
type Unwrapped (Predicate a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Predicate a) = a -> Bool
type Unwrapped (Identity a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Identity a) = a
type Unwrapped (First a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (First a) = Maybe a
type Unwrapped (Last a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Last a) = Maybe a
type Unwrapped (Down a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Down a) = a
type Unwrapped (First a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (First a) = a
type Unwrapped (Last a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Last a) = a
type Unwrapped (Max a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Max a) = a
type Unwrapped (Min a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Min a) = a
type Unwrapped (WrappedMonoid a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedMonoid a) = a
type Unwrapped (Dual a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Dual a) = a
type Unwrapped (Endo a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Endo a) = a -> a
type Unwrapped (Product a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Product a) = a
type Unwrapped (Sum a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Sum a) = a
type Unwrapped (Par1 p) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Par1 p) = p
type Unwrapped (IntMap a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (IntMap a) = [(Int, a)]
type Unwrapped (Seq a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Seq a) = [a]
type Unwrapped (Set a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Set a) = [a]
type Unwrapped (TransInv t) |
Instance details Defined in Diagrams.Core.Transform type Unwrapped (TransInv t) = t
type Unwrapped (ArcLength n) Source # |
Instance details Defined in Diagrams.Segment type Unwrapped (ArcLength n) = (Sum (Interval n), n -> Sum (Interval n))
type Unwrapped (Clip n) Source # |
Instance details Defined in Diagrams.TwoD.Path type Unwrapped (Clip n) = [Path V2 n]
type Unwrapped (HashSet a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (HashSet a) = [a]
type Unwrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Vector a) = [a]
type Unwrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Vector a) = [a]
type Unwrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Vector a) = [a]
type Unwrapped (Vector a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Vector a) = [a]
type Unwrapped (NonEmpty a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (NonEmpty a) = (a, [a])
type Unwrapped (WrappedMonad m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedMonad m a) = m a
type Unwrapped (ArrowMonad m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ArrowMonad m a) = m () a
type Unwrapped (Op a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Op a b) = b -> a
type Unwrapped (Map k a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Map k a) = [(k, a)]
type Unwrapped (Envelope v n) |
Instance details Defined in Diagrams.Core.Envelope type Unwrapped (Envelope v n) = Maybe (v n -> Max n)
type Unwrapped (Style v n) |
Instance details Defined in Diagrams.Core.Style type Unwrapped (Style v n) = HashMap TypeRep (Attribute v n)
type Unwrapped (Trace v n) |
Instance details Defined in Diagrams.Core.Trace type Unwrapped (Trace v n) = Point v n -> v n -> SortedList n
type Unwrapped (Path v n) Source # |
Instance details Defined in Diagrams.Path type Unwrapped (Path v n) = [Located (Trail v n)]
type Unwrapped (TotalOffset v n) Source # |
Instance details Defined in Diagrams.Segment type Unwrapped (TotalOffset v n) = v n
type Unwrapped (SegTree v n) Source # |
Instance details Defined in Diagrams.Trail type Unwrapped (SegTree v n) = FingerTree (SegMeasure v n) (Segment Closed v n)
type Unwrapped (Trail v n) Source # |
Instance details Defined in Diagrams.Trail type Unwrapped (Trail v n) = Either (Trail' Line v n) (Trail' Loop v n)
type Unwrapped (CatchT m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (CatchT m a) = m (Either SomeException a)
type Unwrapped (Alt f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Alt f a) = [AltF f a]
type Unwrapped (CoiterT w a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (CoiterT w a) = w (a, CoiterT w a)
type Unwrapped (IterT m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (IterT m a) = m (Either a (IterT m a))
type Unwrapped (Point f a) |
Instance details Defined in Linear.Affine type Unwrapped (Point f a) = f a
type Unwrapped (MaybeApply f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (MaybeApply f a) = Either (f a) a
type Unwrapped (WrappedApplicative f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedApplicative f a) = f a
type Unwrapped (ListT m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ListT m a) = m [a]
type Unwrapped (MaybeT m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (MaybeT m a) = m (Maybe a)
type Unwrapped (HashMap k a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (HashMap k a) = [(k, a)]
type Unwrapped (WrappedArrow a b c) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedArrow a b c) = a b c
type Unwrapped (Kleisli m a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Kleisli m a b) = a -> m b
type Unwrapped (Const a x) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Const a x) = a
type Unwrapped (Ap f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Ap f a) = f a
type Unwrapped (Alt f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Alt f a) = f a
type Unwrapped (Rec1 f p) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Rec1 f p) = f p
type Unwrapped (Fix p a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Fix p a) = p (Fix p a) a
type Unwrapped (Join p a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Join p a) = p a a
type Unwrapped (TracedT m w a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (TracedT m w a) = w (m -> a)
type Unwrapped (Compose f g a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Compose f g a) = f (g a)
type Unwrapped (ComposeCF f g a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ComposeCF f g a) = f (g a)
type Unwrapped (ComposeFC f g a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ComposeFC f g a) = f (g a)
type Unwrapped (Query v n m) |
Instance details Defined in Diagrams.Core.Query type Unwrapped (Query v n m) = Point v n -> m
type Unwrapped (Trail' Line v n) Source # |
Instance details Defined in Diagrams.Trail type Unwrapped (Trail' Line v n) = SegTree v n
type Unwrapped (ApT f g a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ApT f g a) = g (ApF f g a)
type Unwrapped (CofreeT f w a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (CofreeT f w a) = w (CofreeF f a (CofreeT f w a))
type Unwrapped (FreeT f m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (FreeT f m a) = m (FreeF f a (FreeT f m a))
type Unwrapped (Static f a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Static f a b) = f (a -> b)
type Unwrapped (Tagged s a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Tagged s a) = a
type Unwrapped (Backwards f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Backwards f a) = f a
type Unwrapped (ErrorT e m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ErrorT e m a) = m (Either e a)
type Unwrapped (ExceptT e m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ExceptT e m a) = m (Either e a)
type Unwrapped (IdentityT m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (IdentityT m a) = m a
type Unwrapped (ReaderT r m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ReaderT r m a) = r -> m a
type Unwrapped (StateT s m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (StateT s m a) = s -> m (a, s)
type Unwrapped (StateT s m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (StateT s m a) = s -> m (a, s)
type Unwrapped (WriterT w m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WriterT w m a) = m (a, w)
type Unwrapped (WriterT w m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WriterT w m a) = m (a, w)
type Unwrapped (Constant a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Constant a b) = a
type Unwrapped (Reverse f a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Reverse f a) = f a
type Unwrapped (K1 i c p) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (K1 i c p) = c
type Unwrapped (QDiagram b v n m) |
Instance details Defined in Diagrams.Core.Types type Unwrapped (QDiagram b v n m) = DUALTree (DownAnnots v n) (UpAnnots b v n m) Annotation (QDiaLeaf b v n m)
type Unwrapped (SubMap b v n m) |
Instance details Defined in Diagrams.Core.Types type Unwrapped (SubMap b v n m) = Map Name [Subdiagram b v n m]
type Unwrapped (Costar f d c) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Costar f d c) = f d -> c
type Unwrapped (Forget r a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Forget r a b) = a -> r
type Unwrapped (Star f d c) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Star f d c) = d -> f c
type Unwrapped (ContT r m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (ContT r m a) = (a -> m r) -> m r
type Unwrapped (Compose f g a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Compose f g a) = f (g a)
type Unwrapped ((f :.: g) p) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped ((f :.: g) p) = f (g p)
type Unwrapped (M1 i c f p) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (M1 i c f p) = f p
type Unwrapped (Clown f a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Clown f a b) = f a
type Unwrapped (Flip p a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Flip p a b) = p b a
type Unwrapped (Joker g a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Joker g a b) = g b
type Unwrapped (WrappedBifunctor p a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedBifunctor p a b) = p a b
type Unwrapped (WrappedArrow p a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedArrow p a b) = p a b
type Unwrapped (Semi m a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Semi m a b) = m
type Unwrapped (WrappedCategory k3 a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (WrappedCategory k3 a b) = k3 a b
type Unwrapped (Dual k3 a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Dual k3 a b) = k3 b a
type Unwrapped (RWST r w s m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (RWST r w s m a) = r -> s -> m (a, s, w)
type Unwrapped (RWST r w s m a) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (RWST r w s m a) = r -> s -> m (a, s, w)
type Unwrapped (Tannen f p a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Tannen f p a b) = f (p a b)
type Unwrapped (Cayley f p a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Cayley f p a b) = f (p a b)
type Unwrapped (Biff p f g a b) |
Instance details Defined in Control.Lens.Wrapped type Unwrapped (Biff p f g a b) = p (f a) (g b)

class (Magnified m ~ Magnified n, MonadReader b m, MonadReader a n) => Magnify (m :: Type -> Type) (n :: Type -> Type) b a | m -> b, n -> a, m a -> n, n b -> m where Source #

This class allows us to use `magnify` part of the environment, changing the environment supplied by many different `Monad` transformers. Unlike `zoom` this can change the environment of a deeply nested `Monad` transformer.

Also, unlike `zoom`, this can be used with any valid `Getter`, but cannot be used with a `Traversal` or `Fold`.

Methods

magnify :: ((Functor (Magnified m c), Contravariant (Magnified m c)) => LensLike' (Magnified m c) a b) -> m c -> n c infixr 2 Source #

Run a monadic action in a larger environment than it was defined in, using a `Getter`.

This acts like `local`, but can in many cases change the type of the environment as well.

This is commonly used to lift actions in a simpler `Reader` `Monad` into a `Monad` with a larger environment type.

This can be used to edit pretty much any `Monad` transformer stack with an environment in it:

    >>> (1,2) & magnify _2 (+1)
    3

    >>> flip Reader.runReader (1,2) $ magnify _1 Reader.ask
    1

    >>> flip Reader.runReader (1,2,[10..20]) $ magnify (_3._tail) Reader.ask
    [11,12,13,14,15,16,17,18,19,20]

The type can be read as

      magnify :: LensLike' (Magnified m c) a b -> m c -> n c

but the higher-rank constraints make it easier to apply `magnify` to a `Getter` in highly-polymorphic code.

    magnify :: Getter s a -> (a -> r) -> s -> r
    magnify :: Monoid r => Fold s a   -> (a -> r) -> s -> r

    magnify :: Monoid w                 => Getter s t -> RWS t w st c -> RWS s w st c
    magnify :: (Monoid w, Monoid c) => Fold s a   -> RWS a w st c -> RWS s w st c
    ...

#### Instances

Instances details

Magnify m n b a => Magnify (IdentityT m) (IdentityT n) b a |
Instance details Defined in Control.Lens.Zoom Methods magnify :: ((Functor (Magnified (IdentityT m) c), Contravariant (Magnified (IdentityT m) c)) => LensLike' (Magnified (IdentityT m) c) a b) -> IdentityT m c -> IdentityT n c Source #
Monad m => Magnify (ReaderT b m) (ReaderT a m) b a |
Instance details Defined in Control.Lens.Zoom Methods magnify :: ((Functor (Magnified (ReaderT b m) c), Contravariant (Magnified (ReaderT b m) c)) => LensLike' (Magnified (ReaderT b m) c) a b) -> ReaderT b m c -> ReaderT a m c Source #

Magnify ((->) b) ((->) a) b a

    magnify = views

Instance details Defined in Control.Lens.Zoom Methods magnify :: ((Functor (Magnified ((->) b) c), Contravariant (Magnified ((->) b) c)) => LensLike' (Magnified ((->) b) c) a b) -> (b -> c) -> a -> c Source #
(Monad m, Monoid w) => Magnify (RWST b w s m) (RWST a w s m) b a |
Instance details Defined in Control.Lens.Zoom Methods magnify :: ((Functor (Magnified (RWST b w s m) c), Contravariant (Magnified (RWST b w s m) c)) => LensLike' (Magnified (RWST b w s m) c) a b) -> RWST b w s m c -> RWST a w s m c Source #
(Monad m, Monoid w) => Magnify (RWST b w s m) (RWST a w s m) b a |
Instance details Defined in Control.Lens.Zoom Methods magnify :: ((Functor (Magnified (RWST b w s m) c), Contravariant (Magnified (RWST b w s m) c)) => LensLike' (Magnified (RWST b w s m) c) a b) -> RWST b w s m c -> RWST a w s m c Source #

type family Magnified (m :: Type -> Type) :: Type -> Type -> Type Source #

This type family is used by `Magnify` to describe the common effect type.

#### Instances

Instances details

type Magnified (IdentityT m) |
Instance details Defined in Control.Lens.Zoom type Magnified (IdentityT m) = Magnified m
type Magnified (ReaderT b m) |
Instance details Defined in Control.Lens.Zoom type Magnified (ReaderT b m) = Effect m
type Magnified ((->) b) |
Instance details Defined in Control.Lens.Zoom type Magnified ((->) b) = Const :: Type -> Type -> Type
type Magnified (RWST a w s m) |
Instance details Defined in Control.Lens.Zoom type Magnified (RWST a w s m) = EffectRWS w s m
type Magnified (RWST a w s m) |
Instance details Defined in Control.Lens.Zoom type Magnified (RWST a w s m) = EffectRWS w s m

type family Zoomed (m :: Type -> Type) :: Type -> Type -> Type Source #

This type family is used by `Zoom` to describe the common effect type.

#### Instances

Instances details

type Zoomed (ListT m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (ListT m) = FocusingOn [] (Zoomed m)
type Zoomed (MaybeT m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (MaybeT m) = FocusingMay (Zoomed m)
type Zoomed (FreeT f m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (FreeT f m) = FocusingFree f m (Zoomed m)
type Zoomed (ErrorT e m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (ErrorT e m) = FocusingErr e (Zoomed m)
type Zoomed (ExceptT e m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (ExceptT e m) = FocusingErr e (Zoomed m)
type Zoomed (IdentityT m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (IdentityT m) = Zoomed m
type Zoomed (ReaderT e m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (ReaderT e m) = Zoomed m
type Zoomed (StateT s z) |
Instance details Defined in Control.Lens.Zoom type Zoomed (StateT s z) = Focusing z
type Zoomed (StateT s z) |
Instance details Defined in Control.Lens.Zoom type Zoomed (StateT s z) = Focusing z
type Zoomed (WriterT w m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m)
type Zoomed (WriterT w m) |
Instance details Defined in Control.Lens.Zoom type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m)
type Zoomed (RWST r w s z) |
Instance details Defined in Control.Lens.Zoom type Zoomed (RWST r w s z) = FocusingWith w z
type Zoomed (RWST r w s z) |
Instance details Defined in Control.Lens.Zoom type Zoomed (RWST r w s z) = FocusingWith w z

class GPlated1 (f :: k -> Type) (g :: k -> Type) Source #

Minimal complete definition

gplate1'

#### Instances

Instances details

GPlated1 (f :: Type -> Type) Par1 | ignored
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k). Traversal' (Par1 a) (f a)
GPlated1 (f :: k -> Type) (U1 :: k -> Type) | ignored
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' (U1 a) (f a)
GPlated1 (f :: k -> Type) (V1 :: k -> Type) | ignored
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' (V1 a) (f a)
GPlated1 (f :: k -> Type) (Rec1 f :: k -> Type) | match
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' (Rec1 f a) (f a)
GPlated1 (f :: k -> Type) (Rec1 g :: k -> Type) | ignored
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' (Rec1 g a) (f a)
GPlated1 (f :: k -> Type) (URec a :: k -> Type) | ignored
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a0 :: k0). Traversal' (URec a a0) (f a0)
(GPlated1 f g, GPlated1 f h) => GPlated1 (f :: k -> Type) (g :*: h :: k -> Type) | recursive match
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' ((g :*: h) a) (f a)
(GPlated1 f g, GPlated1 f h) => GPlated1 (f :: k -> Type) (g :+: h :: k -> Type) | recursive match
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' ((g :+: h) a) (f a)
GPlated1 (f :: k -> Type) (K1 i a :: k -> Type) | ignored
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a0 :: k0). Traversal' (K1 i a a0) (f a0)
GPlated1 f g => GPlated1 (f :: k -> Type) (M1 i c g :: k -> Type) | recursive match
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k0). Traversal' (M1 i c g a) (f a)
(Traversable t, GPlated1 f g) => GPlated1 (f :: k1 -> Type) (t :.: g :: k1 -> Type) | recursive match under outer `Traversable` instance
Instance details Defined in Control.Lens.Plated Methods gplate1' :: forall (a :: k). Traversal' ((t :.: g) a) (f a)

class GPlated a (g :: k -> Type) Source #

Minimal complete definition

gplate'

#### Instances

Instances details

GPlated a (U1 :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' (U1 p) a
GPlated a (V1 :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' (V1 p) a
GPlated a (URec b :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' (URec b p) a
(GPlated a f, GPlated a g) => GPlated a (f :*: g :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' ((f :*: g) p) a
(GPlated a f, GPlated a g) => GPlated a (f :+: g :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' ((f :+: g) p) a
GPlated a (K1 i a :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' (K1 i a p) a
GPlated a (K1 i b :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' (K1 i b p) a
GPlated a f => GPlated a (M1 i c f :: k -> Type) |
Instance details Defined in Control.Lens.Plated Methods gplate' :: forall (p :: k0). Traversal' (M1 i c f p) a

class Plated a where Source #

A `Plated` type is one where we know how to extract its immediate self-similar children.

Example 1:

    import Control.Applicative
    import Control.Lens
    import Control.Lens.Plated
    import Data.Data
    import Data.Data.Lens (uniplate)

    data Expr
      = Val Int
      | Neg Expr
      | Add Expr Expr
      deriving (Eq,Ord,Show,Read,Data)

    instance Plated Expr where
      plate f (Neg e) = Neg <$> f e
      plate f (Add a b) = Add <$> f a <*> f b
      plate _ a = pure a

or

    instance Plated Expr where
      plate = uniplate

Example 2:

    import Control.Applicative
    import Control.Lens
    import Control.Lens.Plated
    import Data.Data
    import Data.Data.Lens (uniplate)

    data Tree a
      = Bin (Tree a) (Tree a)
      | Tip a
      deriving (Eq,Ord,Show,Read,Data)

    instance Plated (Tree a) where
      plate f (Bin l r) = Bin <$> f l <*> f r
      plate _ t = pure t

or

    instance Data a => Plated (Tree a) where
      plate = uniplate

Note the big distinction between these two implementations.

The former will only treat children directly in this tree as descendents, the latter will treat trees contained in the values under the tips also as descendants!

When in doubt, pick a `Traversal` and just use the various `...Of` combinators rather than pollute `Plated` with orphan instances!

If you want to find something unplated and non-recursive with `biplate` use the `...OnOf` variant with `ignored`, though those usecases are much better served in most cases by using the existing `Lens` combinators! e.g.

    toListOf biplate ≡ universeOnOf biplate ignored

This same ability to explicitly pass the `Traversal` in question is why there is no analogue to uniplate's `Biplate`.

Moreover, since we can allow custom traversals, we implement reasonable defaults for polymorphic data types, that only `traverse` into themselves, and not their polymorphic arguments.

Minimal complete definition

Nothing

Methods

plate :: Traversal' a a Source #

`Traversal` of the immediate children of this structure.

If you're using GHC 7.2 or newer and your type has a `Data` instance, `plate` will default to `uniplate` and you can choose to not override it with your own definition.

#### Instances

Instances details

Plated Con |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' Con Con Source #
Plated Dec |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' Dec Dec Source #
Plated Exp |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' Exp Exp Source #
Plated Pat |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' Pat Pat Source #
Plated Stmt |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' Stmt Stmt Source #
Plated Type |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' Type Type Source #
Plated (Tree a) |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' (Tree a) (Tree a) Source #
Plated [a] |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' [a] [a] Source #
Traversable f => Plated (Cofree f a) |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' (Cofree f a) (Cofree f a) Source #
Traversable f => Plated (Free f a) |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' (Free f a) (Free f a) Source #
Traversable f => Plated (F f a) |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' (F f a) (F f a) Source #
(Traversable f, Traversable w) => Plated (CofreeT f w a) |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' (CofreeT f w a) (CofreeT f w a) Source #
(Traversable f, Traversable m) => Plated (FreeT f m a) |
Instance details Defined in Control.Lens.Plated Methods plate :: Traversal' (FreeT f m a) (FreeT f m a) Source #

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

Extract `each` element of a (potentially monomorphic) container.

Notably, when applied to a tuple, this generalizes `both` to arbitrary homogeneous tuples.

    >>> (1,2,3) & each *~ 10
    (10,20,30)

It can also be used on monomorphic containers like `Text` or `ByteString`.

    >>> over each Char.toUpper ("hello"^.Text.packed)
    "HELLO"

    >>> ("hello","world") & each.each %~ Char.toUpper
    ("HELLO","WORLD")

Minimal complete definition

Nothing

Methods

each :: Traversal s t a b Source #

#### Instances

Instances details

(a ~ Word8, b ~ Word8) => Each ByteString ByteString a b

    each :: Traversal ByteString ByteString Word8 Word8

Instance details Defined in Control.Lens.Each Methods each :: Traversal ByteString ByteString a b Source #

(a ~ Word8, b ~ Word8) => Each ByteString ByteString a b

    each :: Traversal ByteString ByteString Word8 Word8

Instance details Defined in Control.Lens.Each Methods each :: Traversal ByteString ByteString a b Source #
Each Name Name AName AName |
Instance details Defined in Diagrams.Core.Names Methods each :: Traversal Name Name AName AName Source #

(a ~ Char, b ~ Char) => Each Text Text a b

    each :: Traversal Text Text Char Char

Instance details Defined in Control.Lens.Each Methods each :: Traversal Text Text a b Source #

(a ~ Char, b ~ Char) => Each Text Text a b

    each :: Traversal Text Text Char Char

Instance details Defined in Control.Lens.Each Methods each :: Traversal Text Text a b Source #

Each (Complex a) (Complex b) a b

    each :: (RealFloat a, RealFloat b) => Traversal (Complex a) (Complex b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Complex a) (Complex b) a b Source #

Each (Identity a) (Identity b) a b

    each :: Traversal (Identity a) (Identity b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Identity a) (Identity b) a b Source #

Each (IntMap a) (IntMap b) a b

    each :: Traversal (Map c a) (Map c b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (IntMap a) (IntMap b) a b Source #

Each (Seq a) (Seq b) a b

    each :: Traversal (Seq a) (Seq b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Seq a) (Seq b) a b Source #

Each (Tree a) (Tree b) a b

    each :: Traversal (Tree a) (Tree b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Tree a) (Tree b) a b Source #
Each (Plucker a) (Plucker b) a b |
Instance details Defined in Linear.Plucker Methods each :: Traversal (Plucker a) (Plucker b) a b Source #
Each (Quaternion a) (Quaternion b) a b |
Instance details Defined in Linear.Quaternion Methods each :: Traversal (Quaternion a) (Quaternion b) a b Source #
Each (V0 a) (V0 b) a b |
Instance details Defined in Linear.V0 Methods each :: Traversal (V0 a) (V0 b) a b Source #
Each (V1 a) (V1 b) a b |
Instance details Defined in Linear.V1 Methods each :: Traversal (V1 a) (V1 b) a b Source #
Each (V2 a) (V2 b) a b |
Instance details Defined in Linear.V2 Methods each :: Traversal (V2 a) (V2 b) a b Source #
Each (V3 a) (V3 b) a b |
Instance details Defined in Linear.V3 Methods each :: Traversal (V3 a) (V3 b) a b Source #
Each (V4 a) (V4 b) a b |
Instance details Defined in Linear.V4 Methods each :: Traversal (V4 a) (V4 b) a b Source #
Each (Maybe a) (Maybe b) a b | Since: lens-4.20
Instance details Defined in Control.Lens.Each Methods each :: Traversal (Maybe a) (Maybe b) a b Source #

Each (Vector a) (Vector b) a b

    each :: Traversal (Vector a) (Vector b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Vector a) (Vector b) a b Source #

(Prim a, Prim b) => Each (Vector a) (Vector b) a b

    each :: (Prim a, Prim b) => Traversal (Vector a) (Vector b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Vector a) (Vector b) a b Source #

(Storable a, Storable b) => Each (Vector a) (Vector b) a b

    each :: (Storable a, Storable b) => Traversal (Vector a) (Vector b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Vector a) (Vector b) a b Source #

(Unbox a, Unbox b) => Each (Vector a) (Vector b) a b

    each :: (Unbox a, Unbox b) => Traversal (Vector a) (Vector b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Vector a) (Vector b) a b Source #

Each (NonEmpty a) (NonEmpty b) a b

    each :: Traversal (NonEmpty a) (NonEmpty b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (NonEmpty a) (NonEmpty b) a b Source #

Each (Maybe a) (Maybe b) a b

    each :: Traversal (Maybe a) (Maybe b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Maybe a) (Maybe b) a b Source #

Each [a] [b] a b

    each :: Traversal [a] [b] a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal [a] [b] a b Source #

(Ix i, IArray UArray a, IArray UArray b, i ~ j) => Each (UArray i a) (UArray j b) a b

    each :: (Ix i, IArray UArray a, IArray UArray b) => Traversal (Array i a) (Array i b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (UArray i a) (UArray j b) a b Source #

(a ~ a', b ~ b') => Each (Either a a') (Either b b') a b

    each :: Traversal (Either a a) (Either b b) a b

Since: lens-4.18

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Either a a') (Either b b') a b Source #

(Ix i, i ~ j) => Each (Array i a) (Array j b) a b

    each :: Ix i => Traversal (Array i a) (Array i b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Array i a) (Array j b) a b Source #

c ~ d => Each (Map c a) (Map d b) a b

    each :: Traversal (Map c a) (Map c b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (Map c a) (Map d b) a b Source #
Traversable f => Each (Point f a) (Point f b) a b |
Instance details Defined in Linear.Affine Methods each :: Traversal (Point f a) (Point f b) a b Source #
(a ~ a', b ~ b') => Each (Either a a') (Either b b') a b | Since: lens-4.20
Instance details Defined in Control.Lens.Each Methods each :: Traversal (Either a a') (Either b b') a b Source #
(a ~ a', b ~ b') => Each (These a a') (These b b') a b | Since: lens-4.20
Instance details Defined in Control.Lens.Each Methods each :: Traversal (These a a') (These b b') a b Source #
(a ~ a', b ~ b') => Each (Pair a a') (Pair b b') a b | Since: lens-4.20
Instance details Defined in Control.Lens.Each Methods each :: Traversal (Pair a a') (Pair b b') a b Source #
(a ~ a', b ~ b') => Each (These a a') (These b b') a b | Since: lens-4.20
Instance details Defined in Control.Lens.Each Methods each :: Traversal (These a a') (These b b') a b Source #

c ~ d => Each (HashMap c a) (HashMap d b) a b

    each :: Traversal (HashMap c a) (HashMap c b) a b

Instance details Defined in Control.Lens.Each Methods each :: Traversal (HashMap c a) (HashMap d b) a b Source #

(a ~ a', b ~ b') => Each (a, a') (b, b') a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a') (b, b') a b Source #
Each (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) Source # |
Instance details Defined in Diagrams.Path Methods each :: Traversal (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) Source #
Each (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') |
Instance details Defined in Diagrams.Core.Style Methods each :: Traversal (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') Source #
(Additive v', Foldable v', Ord n') => Each (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') Source # | Only valid if the second point is not smaller than the first.
Instance details Defined in Diagrams.BoundingBox Methods each :: Traversal (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') Source #
Each (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') Source # |
Instance details Defined in Diagrams.Segment Methods each :: Traversal (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') Source #
Each (V n a) (V n b) a b |
Instance details Defined in Linear.V Methods each :: Traversal (V n a) (V n b) a b Source #

(a ~ a2, a ~ a3, b ~ b2, b ~ b3) => Each (a, a2, a3) (b, b2, b3) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3) (b, b2, b3) a b Source #
Each (Offset c v n) (Offset c v' n') (v n) (v' n') Source # |
Instance details Defined in Diagrams.Segment Methods each :: Traversal (Offset c v n) (Offset c v' n') (v n) (v' n') Source #
Each (Segment c v n) (Segment c v' n') (v n) (v' n') Source # |
Instance details Defined in Diagrams.Segment Methods each :: Traversal (Segment c v n) (Segment c v' n') (v n) (v' n') Source #

(a ~ a2, a ~ a3, a ~ a4, b ~ b2, b ~ b3, b ~ b4) => Each (a, a2, a3, a4) (b, b2, b3, b4) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3, a4) (b, b2, b3, b4) a b Source #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, b ~ b2, b ~ b3, b ~ b4, b ~ b5) => Each (a, a2, a3, a4, a5) (b, b2, b3, b4, b5) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3, a4, a5) (b, b2, b3, b4, b5) a b Source #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6) => Each (a, a2, a3, a4, a5, a6) (b, b2, b3, b4, b5, b6) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3, a4, a5, a6) (b, b2, b3, b4, b5, b6) a b Source #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6, b ~ b7) => Each (a, a2, a3, a4, a5, a6, a7) (b, b2, b3, b4, b5, b6, b7) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3, a4, a5, a6, a7) (b, b2, b3, b4, b5, b6, b7) a b Source #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6, b ~ b7, b ~ b8) => Each (a, a2, a3, a4, a5, a6, a7, a8) (b, b2, b3, b4, b5, b6, b7, b8) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3, a4, a5, a6, a7, a8) (b, b2, b3, b4, b5, b6, b7, b8) a b Source #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8, a ~ a9, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6, b ~ b7, b ~ b8, b ~ b9) => Each (a, a2, a3, a4, a5, a6, a7, a8, a9) (b, b2, b3, b4, b5, b6, b7, b8, b9) a b

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

Instance details Defined in Control.Lens.Each Methods each :: Traversal (a, a2, a3, a4, a5, a6, a7, a8, a9) (b, b2, b3, b4, b5, b6, b7, b8, b9) a b Source #

class Ixed m => At m Source #

`At` provides a `Lens` that can be used to read, write or delete the value associated with a key in a `Map`-like container on an ad hoc basis.

An instance of `At` should satisfy:

    ix k ≡ at k . traverse

Minimal complete definition

at

#### Instances

Instances details

At IntSet |
Instance details Defined in Control.Lens.At Methods at :: Index IntSet -> Lens' IntSet (Maybe (IxValue IntSet)) Source #
At (IntMap a) |
Instance details Defined in Control.Lens.At Methods at :: Index (IntMap a) -> Lens' (IntMap a) (Maybe (IxValue (IntMap a))) Source #
Ord k => At (Set k) |
Instance details Defined in Control.Lens.At Methods at :: Index (Set k) -> Lens' (Set k) (Maybe (IxValue (Set k))) Source #
(Eq k, Hashable k) => At (HashSet k) |
Instance details Defined in Control.Lens.At Methods at :: Index (HashSet k) -> Lens' (HashSet k) (Maybe (IxValue (HashSet k))) Source #
At (Maybe a) |
Instance details Defined in Control.Lens.At Methods at :: Index (Maybe a) -> Lens' (Maybe a) (Maybe (IxValue (Maybe a))) Source #
Ord k => At (Map k a) |
Instance details Defined in Control.Lens.At Methods at :: Index (Map k a) -> Lens' (Map k a) (Maybe (IxValue (Map k a))) Source #
At (Style v n) |
Instance details Defined in Diagrams.Core.Style Methods at :: Index (Style v n) -> Lens' (Style v n) (Maybe (IxValue (Style v n))) Source #
(Eq k, Hashable k) => At (HashMap k a) |
Instance details Defined in Control.Lens.At Methods at :: Index (HashMap k a) -> Lens' (HashMap k a) (Maybe (IxValue (HashMap k a))) Source #

class Ixed m where Source #

Provides a simple `Traversal` lets you `traverse` the value at a given key in a `Map` or element at an ordinal position in a list or `Seq`.

Minimal complete definition

Nothing

Methods

ix :: Index m -> Traversal' m (IxValue m) Source #

NB: Setting the value of this `Traversal` will only set the value in `at` if it is already present.

If you want to be able to insert missing values, you want `at`.

    >>> Seq.fromList [a,b,c,d] & ix 2 %~ f
    fromList [a,b,f c,d]

    >>> Seq.fromList [a,b,c,d] & ix 2 .~ e
    fromList [a,b,e,d]

    >>> Seq.fromList [a,b,c,d] ^? ix 2
    Just c

    >>> Seq.fromList [] ^? ix 2
    Nothing

#### Instances

Instances details

Ixed ByteString |
Instance details Defined in Control.Lens.At Methods ix :: Index ByteString -> Traversal' ByteString (IxValue ByteString) Source #
Ixed ByteString |
Instance details Defined in Control.Lens.At Methods ix :: Index ByteString -> Traversal' ByteString (IxValue ByteString) Source #
Ixed IntSet |
Instance details Defined in Control.Lens.At Methods ix :: Index IntSet -> Traversal' IntSet (IxValue IntSet) Source #
Ixed Text |
Instance details Defined in Control.Lens.At Methods ix :: Index Text -> Traversal' Text (IxValue Text) Source #
Ixed Text |
Instance details Defined in Control.Lens.At Methods ix :: Index Text -> Traversal' Text (IxValue Text) Source #
Ixed (Identity a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) Source #
Ixed (IntMap a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (IntMap a) -> Traversal' (IntMap a) (IxValue (IntMap a)) Source #
Ixed (Seq a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Seq a) -> Traversal' (Seq a) (IxValue (Seq a)) Source #
Ord k => Ixed (Set k) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Set k) -> Traversal' (Set k) (IxValue (Set k)) Source #
Ixed (Tree a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Tree a) -> Traversal' (Tree a) (IxValue (Tree a)) Source #
Ixed (Plucker a) |
Instance details Defined in Linear.Plucker Methods ix :: Index (Plucker a) -> Traversal' (Plucker a) (IxValue (Plucker a)) Source #
Ixed (Quaternion a) |
Instance details Defined in Linear.Quaternion Methods ix :: Index (Quaternion a) -> Traversal' (Quaternion a) (IxValue (Quaternion a)) Source #
Ixed (V0 a) |
Instance details Defined in Linear.V0 Methods ix :: Index (V0 a) -> Traversal' (V0 a) (IxValue (V0 a)) Source #
Ixed (V1 a) |
Instance details Defined in Linear.V1 Methods ix :: Index (V1 a) -> Traversal' (V1 a) (IxValue (V1 a)) Source #
Ixed (V2 a) |
Instance details Defined in Linear.V2 Methods ix :: Index (V2 a) -> Traversal' (V2 a) (IxValue (V2 a)) Source #
Ixed (V3 a) |
Instance details Defined in Linear.V3 Methods ix :: Index (V3 a) -> Traversal' (V3 a) (IxValue (V3 a)) Source #
Ixed (V4 a) |
Instance details Defined in Linear.V4 Methods ix :: Index (V4 a) -> Traversal' (V4 a) (IxValue (V4 a)) Source #
(Eq k, Hashable k) => Ixed (HashSet k) |
Instance details Defined in Control.Lens.At Methods ix :: Index (HashSet k) -> Traversal' (HashSet k) (IxValue (HashSet k)) Source #
Ixed (Vector a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) Source #
Prim a => Ixed (Vector a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) Source #
Storable a => Ixed (Vector a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) Source #
Unbox a => Ixed (Vector a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) Source #
Ixed (NonEmpty a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (NonEmpty a) -> Traversal' (NonEmpty a) (IxValue (NonEmpty a)) Source #
Ixed (Maybe a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Maybe a) -> Traversal' (Maybe a) (IxValue (Maybe a)) Source #
Ixed [a] |
Instance details Defined in Control.Lens.At Methods ix :: Index [a] -> Traversal' [a] (IxValue [a]) Source #

(IArray UArray e, Ix i) => Ixed (UArray i e)

    arr ! i ≡ arr ^. ix i
    arr // [(i,e)] ≡ ix i .~ e $ arr

Instance details Defined in Control.Lens.At Methods ix :: Index (UArray i e) -> Traversal' (UArray i e) (IxValue (UArray i e)) Source #

Ix i => Ixed (Array i e)

    arr ! i ≡ arr ^. ix i
    arr // [(i,e)] ≡ ix i .~ e $ arr

Instance details Defined in Control.Lens.At Methods ix :: Index (Array i e) -> Traversal' (Array i e) (IxValue (Array i e)) Source #
Ord k => Ixed (Map k a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) Source #
Ixed (Style v n) |
Instance details Defined in Diagrams.Core.Style Methods ix :: Index (Style v n) -> Traversal' (Style v n) (IxValue (Style v n)) Source #
Ixed (f a) => Ixed (Point f a) |
Instance details Defined in Linear.Affine Methods ix :: Index (Point f a) -> Traversal' (Point f a) (IxValue (Point f a)) Source #
(Eq k, Hashable k) => Ixed (HashMap k a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (HashMap k a) -> Traversal' (HashMap k a) (IxValue (HashMap k a)) Source #
Eq e => Ixed (e -> a) |
Instance details Defined in Control.Lens.At Methods ix :: Index (e -> a) -> Traversal' (e -> a) (IxValue (e -> a)) Source #
a ~ a2 => Ixed (a, a2) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2) -> Traversal' (a, a2) (IxValue (a, a2)) Source #
Ixed (V n a) |
Instance details Defined in Linear.V Methods ix :: Index (V n a) -> Traversal' (V n a) (IxValue (V n a)) Source #
(a ~ a2, a ~ a3) => Ixed (a, a2, a3) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3) -> Traversal' (a, a2, a3) (IxValue (a, a2, a3)) Source #
(a ~ a2, a ~ a3, a ~ a4) => Ixed (a, a2, a3, a4) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3, a4) -> Traversal' (a, a2, a3, a4) (IxValue (a, a2, a3, a4)) Source #
(a ~ a2, a ~ a3, a ~ a4, a ~ a5) => Ixed (a, a2, a3, a4, a5) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3, a4, a5) -> Traversal' (a, a2, a3, a4, a5) (IxValue (a, a2, a3, a4, a5)) Source #
(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6) => Ixed (a, a2, a3, a4, a5, a6) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3, a4, a5, a6) -> Traversal' (a, a2, a3, a4, a5, a6) (IxValue (a, a2, a3, a4, a5, a6)) Source #
(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7) => Ixed (a, a2, a3, a4, a5, a6, a7) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3, a4, a5, a6, a7) -> Traversal' (a, a2, a3, a4, a5, a6, a7) (IxValue (a, a2, a3, a4, a5, a6, a7)) Source #
(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8) => Ixed (a, a2, a3, a4, a5, a6, a7, a8) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3, a4, a5, a6, a7, a8) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8) (IxValue (a, a2, a3, a4, a5, a6, a7, a8)) Source #
(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8, a ~ a9) => Ixed (a, a2, a3, a4, a5, a6, a7, a8, a9) |
Instance details Defined in Control.Lens.At Methods ix :: Index (a, a2, a3, a4, a5, a6, a7, a8, a9) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8, a9) (IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9)) Source #

type family IxValue m Source #

This provides a common notion of a value at an index that is shared by both `Ixed` and `At`.

#### Instances

Instances details

type IxValue ByteString |
Instance details Defined in Control.Lens.At type IxValue ByteString = Word8
type IxValue ByteString |
Instance details Defined in Control.Lens.At type IxValue ByteString = Word8
type IxValue IntSet |
Instance details Defined in Control.Lens.At type IxValue IntSet = ()
type IxValue Text |
Instance details Defined in Control.Lens.At type IxValue Text = Char
type IxValue Text |
Instance details Defined in Control.Lens.At type IxValue Text = Char
type IxValue (Identity a) |
Instance details Defined in Control.Lens.At type IxValue (Identity a) = a
type IxValue (IntMap a) |
Instance details Defined in Control.Lens.At type IxValue (IntMap a) = a
type IxValue (Seq a) |
Instance details Defined in Control.Lens.At type IxValue (Seq a) = a
type IxValue (Set k) |
Instance details Defined in Control.Lens.At type IxValue (Set k) = ()
type IxValue (Tree a) |
Instance details Defined in Control.Lens.At type IxValue (Tree a) = a
type IxValue (Plucker a) |
Instance details Defined in Linear.Plucker type IxValue (Plucker a) = a
type IxValue (Quaternion a) |
Instance details Defined in Linear.Quaternion type IxValue (Quaternion a) = a
type IxValue (V0 a) |
Instance details Defined in Linear.V0 type IxValue (V0 a) = a
type IxValue (V1 a) |
Instance details Defined in Linear.V1 type IxValue (V1 a) = a
type IxValue (V2 a) |
Instance details Defined in Linear.V2 type IxValue (V2 a) = a
type IxValue (V3 a) |
Instance details Defined in Linear.V3 type IxValue (V3 a) = a
type IxValue (V4 a) |
Instance details Defined in Linear.V4 type IxValue (V4 a) = a
type IxValue (HashSet k) |
Instance details Defined in Control.Lens.At type IxValue (HashSet k) = ()
type IxValue (Vector a) |
Instance details Defined in Control.Lens.At type IxValue (Vector a) = a
type IxValue (Vector a) |
Instance details Defined in Control.Lens.At type IxValue (Vector a) = a
type IxValue (Vector a) |
Instance details Defined in Control.Lens.At type IxValue (Vector a) = a
type IxValue (Vector a) |
Instance details Defined in Control.Lens.At type IxValue (Vector a) = a
type IxValue (NonEmpty a) |
Instance details Defined in Control.Lens.At type IxValue (NonEmpty a) = a
type IxValue (Maybe a) |
Instance details Defined in Control.Lens.At type IxValue (Maybe a) = a
type IxValue [a] |
Instance details Defined in Control.Lens.At type IxValue [a] = a
type IxValue (UArray i e) |
Instance details Defined in Control.Lens.At type IxValue (UArray i e) = e
type IxValue (Array i e) |
Instance details Defined in Control.Lens.At type IxValue (Array i e) = e
type IxValue (Map k a) |
Instance details Defined in Control.Lens.At type IxValue (Map k a) = a
type IxValue (Style v n) |
Instance details Defined in Diagrams.Core.Style type IxValue (Style v n) = Attribute v n
type IxValue (Point f a) |
Instance details Defined in Linear.Affine type IxValue (Point f a) = IxValue (f a)
type IxValue (HashMap k a) |
Instance details Defined in Control.Lens.At type IxValue (HashMap k a) = a
type IxValue (e -> a) |
Instance details Defined in Control.Lens.At type IxValue (e -> a) = a

type IxValue (a, a2)

    ix :: Int -> Traversal' (a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2) = a
type IxValue (V n a) |
Instance details Defined in Linear.V type IxValue (V n a) = a

type IxValue (a, a2, a3)

    ix :: Int -> Traversal' (a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3) = a

type IxValue (a, a2, a3, a4)

    ix :: Int -> Traversal' (a,a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3, a4) = a

type IxValue (a, a2, a3, a4, a5)

    ix :: Int -> Traversal' (a,a,a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3, a4, a5) = a

type IxValue (a, a2, a3, a4, a5, a6)

    ix :: Int -> Traversal' (a,a,a,a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3, a4, a5, a6) = a

type IxValue (a, a2, a3, a4, a5, a6, a7)

    ix :: Int -> Traversal' (a,a,a,a,a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3, a4, a5, a6, a7) = a

type IxValue (a, a2, a3, a4, a5, a6, a7, a8)

    ix :: Int -> Traversal' (a,a,a,a,a,a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3, a4, a5, a6, a7, a8) = a

type IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9)

    ix :: Int -> Traversal' (a,a,a,a,a,a,a,a,a) a

Instance details Defined in Control.Lens.At type IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9) = a

class Contains m Source #

This class provides a simple `Lens` that lets you view (and modify) information about whether or not a container contains a given `Index`.

Minimal complete definition

contains

#### Instances

Instances details

Contains IntSet |
Instance details Defined in Control.Lens.At Methods contains :: Index IntSet -> Lens' IntSet Bool Source #
Ord a => Contains (Set a) |
Instance details Defined in Control.Lens.At Methods contains :: Index (Set a) -> Lens' (Set a) Bool Source #
(Eq a, Hashable a) => Contains (HashSet a) |
Instance details Defined in Control.Lens.At Methods contains :: Index (HashSet a) -> Lens' (HashSet a) Bool Source #

type family Index s Source #

#### Instances

Instances details

type Index ByteString |
Instance details Defined in Control.Lens.At type Index ByteString = Int
type Index ByteString |
Instance details Defined in Control.Lens.At type Index ByteString = Int64
type Index IntSet |
Instance details Defined in Control.Lens.At type Index IntSet = Int
type Index Text |
Instance details Defined in Control.Lens.At type Index Text = Int
type Index Text |
Instance details Defined in Control.Lens.At type Index Text = Int64
type Index (Complex a) |
Instance details Defined in Control.Lens.At type Index (Complex a) = Int
type Index (Identity a) |
Instance details Defined in Control.Lens.At type Index (Identity a) = ()
type Index (IntMap a) |
Instance details Defined in Control.Lens.At type Index (IntMap a) = Int
type Index (Seq a) |
Instance details Defined in Control.Lens.At type Index (Seq a) = Int
type Index (Set a) |
Instance details Defined in Control.Lens.At type Index (Set a) = a
type Index (Tree a) |
Instance details Defined in Control.Lens.At type Index (Tree a) = [Int]
type Index (Plucker a) |
Instance details Defined in Linear.Plucker type Index (Plucker a) = E Plucker
type Index (Quaternion a) |
Instance details Defined in Linear.Quaternion type Index (Quaternion a) = E Quaternion
type Index (V0 a) |
Instance details Defined in Linear.V0 type Index (V0 a) = E V0
type Index (V1 a) |
Instance details Defined in Linear.V1 type Index (V1 a) = E V1
type Index (V2 a) |
Instance details Defined in Linear.V2 type Index (V2 a) = E V2
type Index (V3 a) |
Instance details Defined in Linear.V3 type Index (V3 a) = E V3
type Index (V4 a) |
Instance details Defined in Linear.V4 type Index (V4 a) = E V4
type Index (HashSet a) |
Instance details Defined in Control.Lens.At type Index (HashSet a) = a
type Index (Vector a) |
Instance details Defined in Control.Lens.At type Index (Vector a) = Int
type Index (Vector a) |
Instance details Defined in Control.Lens.At type Index (Vector a) = Int
type Index (Vector a) |
Instance details Defined in Control.Lens.At type Index (Vector a) = Int
type Index (Vector a) |
Instance details Defined in Control.Lens.At type Index (Vector a) = Int
type Index (NonEmpty a) |
Instance details Defined in Control.Lens.At type Index (NonEmpty a) = Int
type Index (Maybe a) |
Instance details Defined in Control.Lens.At type Index (Maybe a) = ()
type Index [a] |
Instance details Defined in Control.Lens.At type Index [a] = Int
type Index (UArray i e) |
Instance details Defined in Control.Lens.At type Index (UArray i e) = i
type Index (Array i e) |
Instance details Defined in Control.Lens.At type Index (Array i e) = i
type Index (Map k a) |
Instance details Defined in Control.Lens.At type Index (Map k a) = k
type Index (Style v n) |
Instance details Defined in Diagrams.Core.Style type Index (Style v n) = TypeRep
type Index (Point f a) |
Instance details Defined in Linear.Affine type Index (Point f a) = Index (f a)
type Index (HashMap k a) |
Instance details Defined in Control.Lens.At type Index (HashMap k a) = k
type Index (e -> a) |
Instance details Defined in Control.Lens.At type Index (e -> a) = e
type Index (a, b) |
Instance details Defined in Control.Lens.At type Index (a, b) = Int
type Index (V n a) |
Instance details Defined in Linear.V type Index (V n a) = Int
type Index (a, b, c) |
Instance details Defined in Control.Lens.At type Index (a, b, c) = Int
type Index (a, b, c, d) |
Instance details Defined in Control.Lens.At type Index (a, b, c, d) = Int
type Index (a, b, c, d, e) |
Instance details Defined in Control.Lens.At type Index (a, b, c, d, e) = Int
type Index (a, b, c, d, e, f) |
Instance details Defined in Control.Lens.At type Index (a, b, c, d, e, f) = Int
type Index (a, b, c, d, e, f, g) |
Instance details Defined in Control.Lens.At type Index (a, b, c, d, e, f, g) = Int
type Index (a, b, c, d, e, f, g, h) |
Instance details Defined in Control.Lens.At type Index (a, b, c, d, e, f, g, h) = Int
type Index (a, b, c, d, e, f, g, h, i) |
Instance details Defined in Control.Lens.At type Index (a, b, c, d, e, f, g, h, i) = Int

type ClassyNamer Source #

Arguments

= Name | Name of the data type that lenses are being generated for.
-> Maybe (Name, Name) | Names of the class and the main method it generates, respectively.

The optional rule to create a class and method around a monomorphic data type. If this naming convention is provided, it generates a "classy" lens.

data DefName Source #

Name to give to generated field optics.

Constructors

TopName Name | Simple top-level definition name
MethodName Name Name | makeFields-style class name and method name

#### Instances

Instances details

Show DefName |
Instance details Defined in Control.Lens.Internal.FieldTH Methods showsPrec :: Int -> DefName -> ShowS Source # show :: DefName -> String Source # showList :: [DefName] -> ShowS Source #
Eq DefName |
Instance details Defined in Control.Lens.Internal.FieldTH Methods (==) :: DefName -> DefName -> Bool Source # (/=) :: DefName -> DefName -> Bool Source #
Ord DefName |
Instance details Defined in Control.Lens.Internal.FieldTH Methods compare :: DefName -> DefName -> Ordering Source # (<) :: DefName -> DefName -> Bool Source # (<=) :: DefName -> DefName -> Bool Source # (>) :: DefName -> DefName -> Bool Source # (>=) :: DefName -> DefName -> Bool Source # max :: DefName -> DefName -> DefName Source # min :: DefName -> DefName -> DefName Source #

type FieldNamer Source #

Arguments

= Name | Name of the data type that lenses are being generated for.
-> [Name] | Names of all fields (including the field being named) in the data type.
-> Name | Name of the field being named.
-> [DefName] | Name(s) of the lens functions. If empty, no lens is created for that field.

The rule to create function names of lenses for data fields.

Although it's sometimes useful, you won't need the first two arguments most of the time.

data LensRules Source #

Rules to construct lenses for data fields.

pattern Empty :: AsEmpty s => s Source #

pattern (:>) :: Snoc a a b b => a -> b -> a infixl 5 Source #

pattern (:<) :: Cons b b a a => a -> b -> b infixr 5 Source #

pattern Strict :: Strict s t => t -> s Source #

pattern Lazy :: Strict t s => t -> s Source #

pattern Wrapped :: Rewrapped s s => Unwrapped s -> s Source #

pattern List :: IsList l => [Item l] -> l Source #

pattern Reversed :: Reversing t => t -> t Source #

pattern Swapped :: Swap p => p b a -> p a b Source #

pattern Unwrapped :: Rewrapped t t => t -> Unwrapped t Source #

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

Build a `Lens` from a getter and a setter.

    lens :: Functor f => (s -> a) -> (s -> b -> t) -> (a -> f b) -> s -> f t

    >>> s ^. lens getter setter
    getter s

    >>> s & lens getter setter .~ b
    setter s b

    >>> s & lens getter setter %~ f
    setter s (f (getter s))

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

strict :: Strict lazy strict => Iso' lazy strict Source #

An `Iso` between the lazy variant of a structure and its strict counterpart.

    strict = from lazy

index :: (Indexable i p, Eq i, Applicative f) => i -> Optical' p (Indexed i) f a a Source #

This allows you to filter an `IndexedFold`, `IndexedGetter`, `IndexedTraversal` or `IndexedLens` based on an index.

    >>> ["hello","the","world","!!!"]^?traversed.index 2
    Just "world"

lazy :: Strict lazy strict => Iso' strict lazy Source #

An `Iso` between the strict variant of a structure and its lazy counterpart.

    lazy = from strict

uncons :: Cons s s a a => s -> Maybe (a, s) Source #

Attempt to extract the left-most element from a container, and a version of the container without that element.

    >>> uncons []
    Nothing

    >>> uncons [a, b, c]
    Just (a,[b,c])

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

Invert an isomorphism.

    from (from l) ≡ l

to :: (Profunctor p, Contravariant f) => (s -> a) -> Optic' p f s a Source #

Build an (index-preserving) `Getter` from an arbitrary Haskell function.

    to f . to g ≡ to (g . f)

    a ^. to f ≡ f a

    >>> a ^.to f
    f a

    >>> ("hello","world")^.to snd
    "world"

    >>> 5^.to succ
    6

    >>> (0, -5)^._2.to abs
    5

    to :: (s -> a) -> IndexPreservingGetter s a

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 Source #

Flipped version of `<$>`.

    (<&>) = flip fmap

#### Examples

Expand

Apply `(+1)` to a list, a `Just` and a `Right`:

    >>> Just 2 <&> (+1)
    Just 3

    >>> [1,2,3] <&> (+1)
    [2,3,4]

    >>> Right 3 <&> (+1)
    Right 4

Since: base-4.11.0.0

(&) :: a -> (a -> b) -> b infixl 1 Source #

`&` is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator `$`, which allows `&` to be nested in `$`.

    >>> 5 & (+1) & show
    "6"

Since: base-4.8.0.0

(<|) :: Cons s s a a => a -> s -> s infixr 5 Source #

`cons` an element onto a container.

This is an infix alias for `cons`.

    >>> a <| []
    [a]

    >>> a <| [b, c]
    [a,b,c]

    >>> a <| Seq.fromList []
    fromList [a]

    >>> a <| Seq.fromList [b, c]
    fromList [a,b,c]

cons :: Cons s s a a => a -> s -> s infixr 5 Source #

`cons` an element onto a container.

    >>> cons a []
    [a]

    >>> cons a [b, c]
    [a,b,c]

    >>> cons a (Seq.fromList [])
    fromList [a]

    >>> cons a (Seq.fromList [b, c])
    fromList [a,b,c]

snoc :: Snoc s s a a => s -> a -> s infixl 5 Source #

`snoc` an element onto the end of a container.

    >>> snoc (Seq.fromList []) a
    fromList [a]

    >>> snoc (Seq.fromList [b, c]) a
    fromList [b,c,a]

    >>> snoc (LazyT.pack "hello") '!'
    "hello!"

unsnoc :: Snoc s s a a => s -> Maybe (s, a) Source #

Attempt to extract the right-most element from a container, and a version of the container without that element.

    >>> unsnoc (LazyT.pack "hello!")
    Just ("hello",'!')

    >>> unsnoc (LazyT.pack "")
    Nothing

    >>> unsnoc (Seq.fromList [b,c,a])
    Just (fromList [b,c],a)

    >>> unsnoc (Seq.fromList [])
    Nothing

over :: ASetter s t a b -> (a -> b) -> s -> t Source #

Modify the target of a `Lens` or all the targets of a `Setter` or `Traversal` with a function.

    fmap ≡ over mapped
    fmapDefault ≡ over traverse
    sets . over ≡ id
    over . sets ≡ id

Given any valid `Setter` `l`, you can also rely on the law:

    over l f . over l g = over l (f . g)

e.g.

    >>> over mapped f (over mapped g [a,b,c]) == over mapped (f . g) [a,b,c]
    True

Another way to view `over` is to say that it transforms a `Setter` into a "semantic editor combinator".

    >>> over mapped f (Just a)
    Just (f a)

    >>> over mapped (*10) [1,2,3]
    [10,20,30]

    >>> over _1 f (a,b)
    (f a,b)

    >>> over _1 show (10,20)
    ("10",20)

    over :: Setter s t a b -> (a -> b) -> s -> t
    over :: ASetter s t a b -> (a -> b) -> s -> t

(|>) :: Snoc s s a a => s -> a -> s infixl 5 Source #

`snoc` an element onto the end of a container.

This is an infix alias for `snoc`.

    >>> Seq.fromList [] |> a
    fromList [a]

    >>> Seq.fromList [b, c] |> a
    fromList [b,c,a]

    >>> LazyT.pack "hello" |> '!'
    "hello!"

lastOf :: Getting (Rightmost a) s a -> s -> Maybe a Source #

Retrieve the `Last` entry of a `Fold` or `Traversal` or retrieve `Just` the result from a `Getter` or `Lens`.

The answer is computed in a manner that leaks space less than ``ala` `Last` `.` `foldMapOf`` and gives you back access to the outermost `Just` constructor more quickly, but may have worse constant factors.

    >>> lastOf traverse [1..10]
    Just 10

    >>> lastOf both (1,2)
    Just 2

    >>> lastOf ignored ()
    Nothing

    lastOf :: Getter s a     -> s -> Maybe a
    lastOf :: Fold s a       -> s -> Maybe a
    lastOf :: Lens' s a      -> s -> Maybe a
    lastOf :: Iso' s a       -> s -> Maybe a
    lastOf :: Traversal' s a -> s -> Maybe a

firstOf :: Getting (Leftmost a) s a -> s -> Maybe a Source #

Retrieve the `First` entry of a `Fold` or `Traversal` or retrieve `Just` the result from a `Getter` or `Lens`.

The answer is computed in a manner that leaks space less than ``preview`` or `^?'` and gives you back access to the outermost `Just` constructor more quickly, but does so in a way that builds an intermediate structure, and thus may have worse constant factors. This also means that it can not be used in any `MonadReader`, but must instead have `s` passed as its last argument, unlike `preview`.

Note: this could been named `headOf`.

    >>> firstOf traverse [1..10]
    Just 1

    >>> firstOf both (1,2)
    Just 1

    >>> firstOf ignored ()
    Nothing

    firstOf :: Getter s a     -> s -> Maybe a
    firstOf :: Fold s a       -> s -> Maybe a
    firstOf :: Lens' s a      -> s -> Maybe a
    firstOf :: Iso' s a       -> s -> Maybe a
    firstOf :: Traversal' s a -> s -> Maybe a

traverse1Of_ :: Functor f => Getting (TraversedF r f) s a -> (a -> f r) -> s -> f () Source #

Traverse over all of the targets of a `Fold1`, computing an `Apply` based answer.

As long as you have `Applicative` or `Functor` effect you are better using `traverseOf_`. The `traverse1Of_` is useful only when you have genuine `Apply` effect.

    >>> traverse1Of_ both1 (\ks -> Map.fromList [ (k, ()) | k <- ks ]) ("abc", "bcd")
    fromList [('b',()),('c',())]

    traverse1Of_ :: Apply f => Fold1 s a -> (a -> f r) -> s -> f ()

Since: lens-4.16

traverseOf_ :: Functor f => Getting (Traversed r f) s a -> (a -> f r) -> s -> f () Source #

Traverse over all of the targets of a `Fold` (or `Getter`), computing an `Applicative` (or `Functor`)-based answer, but unlike `traverseOf` do not construct a new structure. `traverseOf_` generalizes `traverse_` to work over any `Fold`.

When passed a `Getter`, `traverseOf_` can work over any `Functor`, but when passed a `Fold`, `traverseOf_` requires an `Applicative`.

    >>> traverseOf_ both putStrLn ("hello","world")
    hello
    world

    traverse_ ≡ traverseOf_ folded

    traverseOf_ _2 :: Functor f => (c -> f r) -> (d, c) -> f ()
    traverseOf_ _Left :: Applicative f => (a -> f b) -> Either a c -> f ()

    itraverseOf_ l ≡ traverseOf_ l . Indexed

The rather specific signature of `traverseOf_` allows it to be used as if the signature was any of:

    traverseOf_ :: Functor f     => Getter s a     -> (a -> f r) -> s -> f ()
    traverseOf_ :: Applicative f => Fold s a       -> (a -> f r) -> s -> f ()
    traverseOf_ :: Functor f     => Lens' s a      -> (a -> f r) -> s -> f ()
    traverseOf_ :: Functor f     => Iso' s a       -> (a -> f r) -> s -> f ()
    traverseOf_ :: Applicative f => Traversal' s a -> (a -> f r) -> s -> f ()
    traverseOf_ :: Applicative f => Prism' s a     -> (a -> f r) -> s -> f ()

cloneLens :: ALens s t a b -> Lens s t a b Source #

Cloning a `Lens` is one way to make sure you aren't given something weaker, such as a `Traversal` and can be used as a way to pass around lenses that have to be monomorphic in `f`.

Note: This only accepts a proper `Lens`.

    >>> let example l x = set (cloneLens l) (x^.cloneLens l + 1) x in example _2 ("hello",1,"you")
    ("hello",2,"you")

taking :: (Conjoined p, Applicative f) => Int -> Traversing p f s t a a -> Over p f s t a a Source #

Visit the first n targets of a `Traversal`, `Fold`, `Getter` or `Lens`.

    >>> [("hello","world"),("!!!","!!!")]^.. taking 2 (traverse.both)
    ["hello","world"]

    >>> timingOut $ [1..] ^.. taking 3 traverse
    [1,2,3]

    >>> over (taking 5 traverse) succ "hello world"
    "ifmmp world"

    taking :: Int -> Traversal' s a                   -> Traversal' s a
    taking :: Int -> Lens' s a                        -> Traversal' s a
    taking :: Int -> Iso' s a                         -> Traversal' s a
    taking :: Int -> Prism' s a                       -> Traversal' s a
    taking :: Int -> Getter s a                       -> Fold s a
    taking :: Int -> Fold s a                         -> Fold s a
    taking :: Int -> IndexedTraversal' i s a          -> IndexedTraversal' i s a
    taking :: Int -> IndexedLens' i s a               -> IndexedTraversal' i s a
    taking :: Int -> IndexedGetter i s a              -> IndexedFold i s a
    taking :: Int -> IndexedFold i s a                -> IndexedFold i s a

traversed :: forall (f :: Type -> Type) a b. Traversable f => IndexedTraversal Int (f a) (f b) a b Source #

Traverse any `Traversable` container. This is an `IndexedTraversal` that is indexed by ordinal position.

foldMapOf :: Getting r s a -> (a -> r) -> s -> r Source #

Map each part of a structure viewed through a `Lens`, `Getter`, `Fold` or `Traversal` to a monoid and combine the results.

    >>> foldMapOf (folded . both . _Just) Sum [(Just 21, Just 21)]
    Sum {getSum = 42}

    foldMap = foldMapOf folded

    foldMapOf ≡ views
    ifoldMapOf l = foldMapOf l . Indexed

    foldMapOf ::                Getter s a      -> (a -> r) -> s -> r
    foldMapOf :: Monoid r    => Fold s a        -> (a -> r) -> s -> r
    foldMapOf :: Semigroup r => Fold1 s a       -> (a -> r) -> s -> r
    foldMapOf ::                Lens' s a       -> (a -> r) -> s -> r
    foldMapOf ::                Iso' s a        -> (a -> r) -> s -> r
    foldMapOf :: Monoid r    => Traversal' s a  -> (a -> r) -> s -> r
    foldMapOf :: Semigroup r => Traversal1' s a -> (a -> r) -> s -> r
    foldMapOf :: Monoid r    => Prism' s a      -> (a -> r) -> s -> r

    foldMapOf :: Getting r s a -> (a -> r) -> s -> r

re :: AReview t b -> Getter b t Source #

Turn a `Prism` or `Iso` around to build a `Getter`.

If you have an `Iso`, `from` is a more powerful version of this function that will return an `Iso` instead of a mere `Getter`.

    >>> 5 ^.re _Left
    Left 5

    >>> 6 ^.re (_Left.unto succ)
    Left 7

    review  ≡ view  . re
    reviews ≡ views . re
    reuse   ≡ use   . re
    reuses  ≡ uses  . re

    re :: Prism s t a b -> Getter b t
    re :: Iso s t a b   -> Getter b t

review :: MonadReader b m => AReview t b -> m t Source #

This can be used to turn an `Iso` or `Prism` around and `view` a value (or the current environment) through it the other way.

    review ≡ view . re
    review . unto ≡ id

    >>> review _Left "mustard"
    Left "mustard"

    >>> review (unto succ) 5
    6

Usually `review` is used in the `(->)` `Monad` with a `Prism` or `Iso`, in which case it may be useful to think of it as having one of these more restricted type signatures:

    review :: Iso' s a   -> a -> s
    review :: Prism' s a -> a -> s

However, when working with a `Monad` transformer stack, it is sometimes useful to be able to `review` the current environment, in which case it may be beneficial to think of it as having one of these slightly more liberal type signatures:

    review :: MonadReader a m => Iso' s a   -> m s
    review :: MonadReader a m => Prism' s a -> m s

preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a) Source #

Retrieve the first value targeted by a `Fold` or `Traversal` (or `Just` the result from a `Getter` or `Lens`). See also `firstOf` and `^?`, which are similar with some subtle differences (explained below).

    listToMaybe . toList ≡ preview folded

    preview = view . pre

Unlike `^?`, this function uses a `MonadReader` to read the value to be focused in on. This allows one to pass the value as the last argument by using the `MonadReader` instance for `(->) s` However, it may also be used as part of some deeply nested transformer stack.

`preview` uses a monoidal value to obtain the result. This means that it generally has good performance, but can occasionally cause space leaks or even stack overflows on some data types. There is another function, `firstOf`, which avoids these issues at the cost of a slight constant performance cost and a little less flexibility.

It may be helpful to think of `preview` as having one of the following more specialized types:

    preview :: Getter s a     -> s -> Maybe a
    preview :: Fold s a       -> s -> Maybe a
    preview :: Lens' s a      -> s -> Maybe a
    preview :: Iso' s a       -> s -> Maybe a
    preview :: Traversal' s a -> s -> Maybe a

    preview :: MonadReader s m => Getter s a     -> m (Maybe a)
    preview :: MonadReader s m => Fold s a       -> m (Maybe a)
    preview :: MonadReader s m => Lens' s a      -> m (Maybe a)
    preview :: MonadReader s m => Iso' s a       -> m (Maybe a)
    preview :: MonadReader s m => Traversal' s a -> m (Maybe a)

(^?) :: s -> Getting (First a) s a -> Maybe a infixl 8 Source #

Perform a safe `head` of a `Fold` or `Traversal` or retrieve `Just` the result from a `Getter` or `Lens`.

When using a `Traversal` as a partial `Lens`, or a `Fold` as a partial `Getter` this can be a convenient way to extract the optional value.

Note: if you get stack overflows due to this, you may want to use `firstOf` instead, which can deal more gracefully with heavily left-biased trees. This is because `^?` works by using the `First` monoid, which can occasionally cause space leaks.

    >>> Left 4 ^?_Left
    Just 4

    >>> Right 4 ^?_Left
    Nothing

    >>> "world" ^? ix 3
    Just 'l'

    >>> "world" ^? ix 20
    Nothing

This operator works as an infix version of `preview`.

    (^?) ≡ flip preview

It may be helpful to think of `^?` as having one of the following more specialized types:

    (^?) :: s -> Getter s a     -> Maybe a
    (^?) :: s -> Fold s a       -> Maybe a
    (^?) :: s -> Lens' s a      -> Maybe a
    (^?) :: s -> Iso' s a       -> Maybe a
    (^?) :: s -> Traversal' s a -> Maybe a

matching :: APrism s t a b -> s -> Either t a Source #

Retrieve the value targeted by a `Prism` or return the original value while allowing the type to change if it does not match.

    >>> matching _Just (Just 12)
    Right 12

    >>> matching _Just (Nothing :: Maybe Int) :: Either (Maybe Bool) Int
    Left Nothing

lengthOf :: Getting (Endo (Endo Int)) s a -> s -> Int Source #

Calculate the number of targets there are for a `Fold` in a given container.

Note: This can be rather inefficient for large containers and just like `length`, this will not terminate for infinite folds.

    length ≡ lengthOf folded

    >>> lengthOf _1 ("hello",())
    1

    >>> lengthOf traverse [1..10]
    10

    >>> lengthOf (traverse.traverse) [[1,2],[3,4],[5,6]]
    6

    lengthOf (folded . folded) :: (Foldable f, Foldable g) => f (g a) -> Int

    lengthOf :: Getter s a     -> s -> Int
    lengthOf :: Fold s a       -> s -> Int
    lengthOf :: Lens' s a      -> s -> Int
    lengthOf :: Iso' s a       -> s -> Int
    lengthOf :: Traversal' s a -> s -> Int

prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b Source #

Build a `Prism`.

``Either` t a` is used instead of ``Maybe` a` to permit the types of `s` and `t` to differ.

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

Replace the target of a `Lens` or all of the targets of a `Setter` or `Traversal` with a constant value.

    (<$) ≡ set mapped

    >>> set _2 "hello" (1,())
    (1,"hello")

    >>> set mapped () [1,2,3,4]
    [(),(),(),()]

Note: Attempting to `set` a `Fold` or `Getter` will fail at compile time with an relatively nice error message.

    set :: Setter s t a b    -> b -> s -> t
    set :: Iso s t a b       -> b -> s -> t
    set :: Lens s t a b      -> b -> s -> t
    set :: Traversal s t a b -> b -> s -> t

view :: MonadReader s m => Getting a s a -> m a Source #

View the value pointed to by a `Getter`, `Iso` or `Lens` or the result of folding over all the results of a `Fold` or `Traversal` that points at a monoidal value.

    view . to ≡ id

    >>> view (to f) a
    f a

    >>> view _2 (1,"hello")
    "hello"

    >>> view (to succ) 5
    6

    >>> view (_2._1) ("hello",("world","!!!"))
    "world"

As `view` is commonly used to access the target of a `Getter` or obtain a monoidal summary of the targets of a `Fold`, It may be useful to think of it as having one of these more restricted signatures:

    view ::             Getter s a     -> s -> a
    view :: Monoid m => Fold s m       -> s -> m
    view ::             Iso' s a       -> s -> a
    view ::             Lens' s a      -> s -> a
    view :: Monoid m => Traversal' s m -> s -> m

In a more general setting, such as when working with a `Monad` transformer stack you can use:

    view :: MonadReader s m             => Getter s a     -> m a
    view :: (MonadReader s m, Monoid a) => Fold s a       -> m a
    view :: MonadReader s m             => Iso' s a       -> m a
    view :: MonadReader s m             => Lens' s a      -> m a
    view :: (MonadReader s m, Monoid a) => Traversal' s a -> m a

cloneTraversal :: ATraversal s t a b -> Traversal s t a b Source #

A `Traversal` is completely characterized by its behavior on a `Bazaar`.

Cloning a `Traversal` is one way to make sure you aren't given something weaker, such as a `Fold` and can be used as a way to pass around traversals that have to be monomorphic in `f`.

Note: This only accepts a proper `Traversal` (or `Lens`). To clone a `Lens` as such, use `cloneLens`.

Note: It is usually better to use `ReifiedTraversal` and `runTraversal` than to `cloneTraversal`. The former can execute at full speed, while the latter needs to round trip through the `Bazaar`.

    >>> let foo l a = (view (getting (cloneTraversal l)) a, set (cloneTraversal l) 10 a)
    >>> foo both ("hello","world")
    ("helloworld",(10,10))

    cloneTraversal :: LensLike (Bazaar (->) a b) s t a b -> Traversal s t a b

use :: MonadState s m => Getting a s a -> m a Source #

Use the target of a `Lens`, `Iso`, or `Getter` in the current state, or use a summary of a `Fold` or `Traversal` that points to a monoidal value.

    >>> evalState (use _1) (a,b)
    a

    >>> evalState (use _1) ("hello","world")
    "hello"

    use :: MonadState s m             => Getter s a     -> m a
    use :: (MonadState s m, Monoid r) => Fold s r       -> m r
    use :: MonadState s m             => Iso' s a       -> m a
    use :: MonadState s m             => Lens' s a      -> m a
    use :: (MonadState s m, Monoid r) => Traversal' s r -> m r

(^.) :: s -> Getting a s a -> a infixl 8 Source #

View the value pointed to by a `Getter` or `Lens` or the result of folding over all the results of a `Fold` or `Traversal` that points at a monoidal values.

This is the same operation as `view` with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (`.`).

    >>> (a,b)^._2
    b

    >>> ("hello","world")^._2
    "world"

    >>> import Data.Complex
    >>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
    2.23606797749979

    (^.) ::             s -> Getter s a     -> a
    (^.) :: Monoid m => s -> Fold s m       -> m
    (^.) ::             s -> Iso' s a       -> a
    (^.) ::             s -> Lens' s a      -> a
    (^.) :: Monoid m => s -> Traversal' s m -> m

(.~) :: ASetter s t a b -> b -> s -> t infixr 4 Source #

Replace the target of a `Lens` or all of the targets of a `Setter` or `Traversal` with a constant value.

This is an infix version of `set`, provided for consistency with (`.=`).

    f <$ a ≡ mapped .~ f $ a

    >>> (a,b,c,d) & _4 .~ e
    (a,b,c,e)

    >>> (42,"world") & _1 .~ "hello"
    ("hello","world")

    >>> (a,b) & both .~ c
    (c,c)

    (.~) :: Setter s t a b    -> b -> s -> t
    (.~) :: Iso s t a b       -> b -> s -> t
    (.~) :: Lens s t a b      -> b -> s -> t
    (.~) :: Traversal s t a b -> b -> s -> t

(%~) :: ASetter s t a b -> (a -> b) -> s -> t infixr 4 Source #

Modifies the target of a `Lens` or all of the targets of a `Setter` or `Traversal` with a user supplied function.

This is an infix version of `over`.

    fmap f ≡ mapped %~ f
    fmapDefault f ≡ traverse %~ f

    >>> (a,b,c) & _3 %~ f
    (a,b,f c)

    >>> (a,b) & both %~ f
    (f a,f b)

    >>> _2 %~ length $ (1,"hello")
    (1,5)

    >>> traverse %~ f $ [a,b,c]
    [f a,f b,f c]

    >>> traverse %~ even $ [1,2,3]
    [False,True,False]

    >>> traverse.traverse %~ length $ [["hello","world"],["!!!"]]
    [[5,5],[3]]

    (%~) :: Setter s t a b    -> (a -> b) -> s -> t
    (%~) :: Iso s t a b       -> (a -> b) -> s -> t
    (%~) :: Lens s t a b      -> (a -> b) -> s -> t
    (%~) :: Traversal s t a b -> (a -> b) -> s -> t

(+~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 Source #

Increment the target(s) of a numerically valued `Lens`, `Setter` or `Traversal`.

    >>> (a,b) & _1 +~ c
    (a + c,b)

    >>> (a,b) & both +~ c
    (a + c,b + c)

    >>> (1,2) & _2 +~ 1
    (1,3)

    >>> [(a,b),(c,d)] & traverse.both +~ e
    [(a + e,b + e),(c + e,d + e)]

    (+~) :: Num a => Setter' s a    -> a -> s -> s
    (+~) :: Num a => Iso' s a       -> a -> s -> s
    (+~) :: Num a => Lens' s a      -> a -> s -> s
    (+~) :: Num a => Traversal' s a -> a -> s -> s

(-~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 Source #

Decrement the target(s) of a numerically valued `Lens`, `Iso`, `Setter` or `Traversal`.

    >>> (a,b) & _1 -~ c
    (a - c,b)

    >>> (a,b) & both -~ c
    (a - c,b - c)

    >>> _1 -~ 2 $ (1,2)
    (-1,2)

    >>> mapped.mapped -~ 1 $ [[4,5],[6,7]]
    [[3,4],[5,6]]

    (-~) :: Num a => Setter' s a    -> a -> s -> s
    (-~) :: Num a => Iso' s a       -> a -> s -> s
    (-~) :: Num a => Lens' s a      -> a -> s -> s
    (-~) :: Num a => Traversal' s a -> a -> s -> s

(*~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 Source #

Multiply the target(s) of a numerically valued `Lens`, `Iso`, `Setter` or `Traversal`.

    >>> (a,b) & _1 *~ c
    (a * c,b)

    >>> (a,b) & both *~ c
    (a * c,b * c)

    >>> (1,2) & _2 *~ 4
    (1,8)

    >>> Just 24 & mapped *~ 2
    Just 48

    (*~) :: Num a => Setter' s a    -> a -> s -> s
    (*~) :: Num a => Iso' s a       -> a -> s -> s
    (*~) :: Num a => Lens' s a      -> a -> s -> s
    (*~) :: Num a => Traversal' s a -> a -> s -> s

(//~) :: Fractional a => ASetter s t a a -> a -> s -> t infixr 4 Source #

Divide the target(s) of a numerically valued `Lens`, `Iso`, `Setter` or `Traversal`.

    >>> (a,b) & _1 //~ c
    (a / c,b)

    >>> (a,b) & both //~ c
    (a / c,b / c)

    >>> ("Hawaii",10) & _2 //~ 2
    ("Hawaii",5.0)

    (//~) :: Fractional a => Setter' s a    -> a -> s -> s
    (//~) :: Fractional a => Iso' s a       -> a -> s -> s
    (//~) :: Fractional a => Lens' s a      -> a -> s -> s
    (//~) :: Fractional a => Traversal' s a -> a -> s -> s

(^~) :: (Num a, Integral e) => ASetter s t a a -> e -> s -> t infixr 4 Source #

Raise the target(s) of a numerically valued `Lens`, `Setter` or `Traversal` to a non-negative integral power.

    >>> (1,3) & _2 ^~ 2
    (1,9)

    (^~) :: (Num a, Integral e) => Setter' s a    -> e -> s -> s
    (^~) :: (Num a, Integral e) => Iso' s a       -> e -> s -> s
    (^~) :: (Num a, Integral e) => Lens' s a      -> e -> s -> s
    (^~) :: (Num a, Integral e) => Traversal' s a -> e -> s -> s

(^^~) :: (Fractional a, Integral e) => ASetter s t a a -> e -> s -> t infixr 4 Source #

Raise the target(s) of a fractionally valued `Lens`, `Setter` or `Traversal` to an integral power.

    >>> (1,2) & _2 ^^~ (-1)
    (1,0.5)

    (^^~) :: (Fractional a, Integral e) => Setter' s a    -> e -> s -> s
    (^^~) :: (Fractional a, Integral e) => Iso' s a       -> e -> s -> s
    (^^~) :: (Fractional a, Integral e) => Lens' s a      -> e -> s -> s
    (^^~) :: (Fractional a, Integral e) => Traversal' s a -> e -> s -> s

(**~) :: Floating a => ASetter s t a a -> a -> s -> t infixr 4 Source #

Raise the target(s) of a floating-point valued `Lens`, `Setter` or `Traversal` to an arbitrary power.

    >>> (a,b) & _1 **~ c
    (a**c,b)

    >>> (a,b) & both **~ c
    (a**c,b**c)

    >>> _2 **~ 10 $ (3,2)
    (3,1024.0)

    (**~) :: Floating a => Setter' s a    -> a -> s -> s
    (**~) :: Floating a => Iso' s a       -> a -> s -> s
    (**~) :: Floating a => Lens' s a      -> a -> s -> s
    (**~) :: Floating a => Traversal' s a -> a -> s -> s

(||~) :: ASetter s t Bool Bool -> Bool -> s -> t infixr 4 Source #

Logically `||` the target(s) of a `Bool`-valued `Lens` or `Setter`.

    >>> both ||~ True $ (False,True)
    (True,True)

    >>> both ||~ False $ (False,True)
    (False,True)

    (||~) :: Setter' s Bool    -> Bool -> s -> s
    (||~) :: Iso' s Bool       -> Bool -> s -> s
    (||~) :: Lens' s Bool      -> Bool -> s -> s
    (||~) :: Traversal' s Bool -> Bool -> s -> s

(&&~) :: ASetter s t Bool Bool -> Bool -> s -> t infixr 4 Source #

Logically `&&` the target(s) of a `Bool`-valued `Lens` or `Setter`.

    >>> both &&~ True $ (False, True)
    (False,True)

    >>> both &&~ False $ (False, True)
    (False,False)

    (&&~) :: Setter' s Bool    -> Bool -> s -> s
    (&&~) :: Iso' s Bool       -> Bool -> s -> s
    (&&~) :: Lens' s Bool      -> Bool -> s -> s
    (&&~) :: Traversal' s Bool -> Bool -> s -> s

(?~) :: ASetter s t a (Maybe b) -> b -> s -> t infixr 4 Source #

Set the target of a `Lens`, `Traversal` or `Setter` to `Just` a value.

    l ?~ t ≡ set l (Just t)

    >>> Nothing & id ?~ a
    Just a

    >>> Map.empty & at 3 ?~ x
    fromList [(3,x)]

`?~` can be used type-changily:

    >>> ('a', ('b', 'c')) & _2.both ?~ 'x'
    ('a',(Just 'x',Just 'x'))

    (?~) :: Setter s t a (Maybe b)    -> b -> s -> t
    (?~) :: Iso s t a (Maybe b)       -> b -> s -> t
    (?~) :: Lens s t a (Maybe b)      -> b -> s -> t
    (?~) :: Traversal s t a (Maybe b) -> b -> s -> t

(<>~) :: Semigroup a => ASetter s t a a -> a -> s -> t infixr 4 Source #

Modify the target of a `Semigroup` value by using `(`<>`)`.

    >>> (Sum a,b) & _1 <>~ Sum c
    (Sum {getSum = a + c},b)

    >>> (Sum a,Sum b) & both <>~ Sum c
    (Sum {getSum = a + c},Sum {getSum = b + c})

    >>> both <>~ "!!!" $ ("hello","world")
    ("hello!!!","world!!!")

    (<>~) :: Semigroup a => Setter s t a a    -> a -> s -> t
    (<>~) :: Semigroup a => Iso s t a a       -> a -> s -> t
    (<>~) :: Semigroup a => Lens s t a a      -> a -> s -> t
    (<>~) :: Semigroup a => Traversal s t a a -> a -> s -> t

(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m () infix 4 Source #

Map over the target of a `Lens` or all of the targets of a `Setter` or `Traversal` in our monadic state.

    >>> execState (do _1 %= f;_2 %= g) (a,b)
    (f a,g b)

    >>> execState (do both %= f) (a,b)
    (f a,f b)

    (%=) :: MonadState s m => Iso' s a       -> (a -> a) -> m ()
    (%=) :: MonadState s m => Lens' s a      -> (a -> a) -> m ()
    (%=) :: MonadState s m => Traversal' s a -> (a -> a) -> m ()
    (%=) :: MonadState s m => Setter' s a    -> (a -> a) -> m ()

    (%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()

(+=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, `Iso`, `Setter` or `Traversal` by adding a value.

Example:

    fresh :: MonadState Int m => m Int
    fresh = do
      id += 1
      use id

    >>> execState (do _1 += c; _2 += d) (a,b)
    (a + c,b + d)

    >>> execState (do _1.at 1.non 0 += 10) (Map.fromList [(2,100)],"hello")
    (fromList [(1,10),(2,100)],"hello")

    (+=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
    (+=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
    (+=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
    (+=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(-=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, `Iso`, `Setter` or `Traversal` by subtracting a value.

    >>> execState (do _1 -= c; _2 -= d) (a,b)
    (a - c,b - d)

    (-=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
    (-=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
    (-=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
    (-=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(*=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, `Iso`, `Setter` or `Traversal` by multiplying by value.

    >>> execState (do _1 *= c; _2 *= d) (a,b)
    (a * c,b * d)

    (*=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
    (*=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
    (*=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
    (*=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(//=) :: (MonadState s m, Fractional a) => ASetter' s a -> a -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, `Iso`, `Setter` or `Traversal` by dividing by a value.

    >>> execState (do _1 //= c; _2 //= d) (a,b)
    (a / c,b / d)

    (//=) :: (MonadState s m, Fractional a) => Setter' s a    -> a -> m ()
    (//=) :: (MonadState s m, Fractional a) => Iso' s a       -> a -> m ()
    (//=) :: (MonadState s m, Fractional a) => Lens' s a      -> a -> m ()
    (//=) :: (MonadState s m, Fractional a) => Traversal' s a -> a -> m ()

(^=) :: (MonadState s m, Num a, Integral e) => ASetter' s a -> e -> m () infix 4 Source #

Raise the target(s) of a numerically valued `Lens`, `Setter` or `Traversal` to a non-negative integral power.

    (^=) ::  (MonadState s m, Num a, Integral e) => Setter' s a    -> e -> m ()
    (^=) ::  (MonadState s m, Num a, Integral e) => Iso' s a       -> e -> m ()
    (^=) ::  (MonadState s m, Num a, Integral e) => Lens' s a      -> e -> m ()
    (^=) ::  (MonadState s m, Num a, Integral e) => Traversal' s a -> e -> m ()

(^^=) :: (MonadState s m, Fractional a, Integral e) => ASetter' s a -> e -> m () infix 4 Source #

Raise the target(s) of a numerically valued `Lens`, `Setter` or `Traversal` to an integral power.

    (^^=) ::  (MonadState s m, Fractional a, Integral e) => Setter' s a    -> e -> m ()
    (^^=) ::  (MonadState s m, Fractional a, Integral e) => Iso' s a       -> e -> m ()
    (^^=) ::  (MonadState s m, Fractional a, Integral e) => Lens' s a      -> e -> m ()
    (^^=) ::  (MonadState s m, Fractional a, Integral e) => Traversal' s a -> e -> m ()

(**=) :: (MonadState s m, Floating a) => ASetter' s a -> a -> m () infix 4 Source #

Raise the target(s) of a numerically valued `Lens`, `Setter` or `Traversal` to an arbitrary power

    >>> execState (do _1 **= c; _2 **= d) (a,b)
    (a**c,b**d)

    (**=) ::  (MonadState s m, Floating a) => Setter' s a    -> a -> m ()
    (**=) ::  (MonadState s m, Floating a) => Iso' s a       -> a -> m ()
    (**=) ::  (MonadState s m, Floating a) => Lens' s a      -> a -> m ()
    (**=) ::  (MonadState s m, Floating a) => Traversal' s a -> a -> m ()

(||=) :: MonadState s m => ASetter' s Bool -> Bool -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, 'Iso, `Setter` or `Traversal` by taking their logical `||` with a value.

    >>> execState (do _1 ||= True; _2 ||= False; _3 ||= True; _4 ||= False) (True,True,False,False)
    (True,True,True,False)

    (||=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
    (||=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
    (||=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
    (||=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()

(&&=) :: MonadState s m => ASetter' s Bool -> Bool -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, `Iso`, `Setter` or `Traversal` by taking their logical `&&` with a value.

    >>> execState (do _1 &&= True; _2 &&= False; _3 &&= True; _4 &&= False) (True,True,False,False)
    (True,False,False,False)

    (&&=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
    (&&=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
    (&&=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
    (&&=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()

(.=) :: MonadState s m => ASetter s s a b -> b -> m () infix 4 Source #

Replace the target of a `Lens` or all of the targets of a `Setter` or `Traversal` in our monadic state with a new value, irrespective of the old.

This is an infix version of `assign`.

    >>> execState (do _1 .= c; _2 .= d) (a,b)
    (c,d)

    >>> execState (both .= c) (a,b)
    (c,c)

    (.=) :: MonadState s m => Iso' s a       -> a -> m ()
    (.=) :: MonadState s m => Lens' s a      -> a -> m ()
    (.=) :: MonadState s m => Traversal' s a -> a -> m ()
    (.=) :: MonadState s m => Setter' s a    -> a -> m ()

It puts the state in the monad or it gets the hose again.

(?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m () infix 4 Source #

Replace the target of a `Lens` or all of the targets of a `Setter` or `Traversal` in our monadic state with `Just` a new value, irrespective of the old.

    >>> execState (do at 1 ?= a; at 2 ?= b) Map.empty
    fromList [(1,a),(2,b)]

    >>> execState (do _1 ?= b; _2 ?= c) (Just a, Nothing)
    (Just b,Just c)

    (?=) :: MonadState s m => Iso' s (Maybe a)       -> a -> m ()
    (?=) :: MonadState s m => Lens' s (Maybe a)      -> a -> m ()
    (?=) :: MonadState s m => Traversal' s (Maybe a) -> a -> m ()
    (?=) :: MonadState s m => Setter' s (Maybe a)    -> a -> m ()

(<>=) :: (MonadState s m, Semigroup a) => ASetter' s a -> a -> m () infix 4 Source #

Modify the target(s) of a `Lens'`, `Iso`, `Setter` or `Traversal` by using `(`<>`)`.

    >>> execState (do _1 <>= Sum c; _2 <>= Product d) (Sum a,Product b)
    (Sum {getSum = a + c},Product {getProduct = b * d})

    >>> execState (both <>= "!!!") ("hello","world")
    ("hello!!!","world!!!")

    (<>=) :: (MonadState s m, Semigroup a) => Setter' s a -> a -> m ()
    (<>=) :: (MonadState s m, Semigroup a) => Iso' s a -> a -> m ()
    (<>=) :: (MonadState s m, Semigroup a) => Lens' s a -> a -> m ()
    (<>=) :: (MonadState s m, Semigroup a) => Traversal' s a -> a -> m ()

(%@~) :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t infixr 4 Source #

Adjust every target of an `IndexedSetter`, `IndexedLens` or `IndexedTraversal` with access to the index.

    (%@~) ≡ iover

When you do not need access to the index then (`%~`) is more liberal in what it can accept.

    l %~ f ≡ l %@~ const f

    (%@~) :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
    (%@~) :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
    (%@~) :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

withIndex :: (Indexable i p, Functor f) => p (i, s) (f (j, t)) -> Indexed i s (f t) Source #

Fold a container with indices returning both the indices and the values.

The result is only valid to compose in a `Traversal`, if you don't edit the index as edits to the index have no effect.

    >>> [10, 20, 30] ^.. ifolded . withIndex
    [(0,10),(1,20),(2,30)]

    >>> [10, 20, 30] ^.. ifolded . withIndex . alongside negated (re _Show)
    [(0,"10"),(-1,"20"),(-2,"30")]

(<.~) :: ASetter s t a b -> b -> s -> (b, t) infixr 4 Source #

Set with pass-through.

This is mostly present for consistency, but may be useful for chaining assignments.

If you do not need a copy of the intermediate result, then using `l `.~` t` directly is a good idea.

    >>> (a,b) & _1 <.~ c
    (c,(c,b))

    >>> ("good","morning","vietnam") & _3 <.~ "world"
    ("world",("good","morning","world"))

    >>> (42,Map.fromList [("goodnight","gracie")]) & _2.at "hello" <.~ Just "world"
    (Just "world",(42,fromList [("goodnight","gracie"),("hello","world")]))

    (<.~) :: Setter s t a b    -> b -> s -> (b, t)
    (<.~) :: Iso s t a b       -> b -> s -> (b, t)
    (<.~) :: Lens s t a b      -> b -> s -> (b, t)
    (<.~) :: Traversal s t a b -> b -> s -> (b, t)

(<.=) :: MonadState s m => ASetter s s a b -> b -> m b infix 4 Source #

Set with pass-through

This is useful for chaining assignment without round-tripping through your `Monad` stack.

    do x <- _2 <.= ninety_nine_bottles_of_beer_on_the_wall

If you do not need a copy of the intermediate result, then using `l `.=` d` will avoid unused binding warnings.

    (<.=) :: MonadState s m => Setter s s a b    -> b -> m b
    (<.=) :: MonadState s m => Iso s s a b       -> b -> m b
    (<.=) :: MonadState s m => Lens s s a b      -> b -> m b
    (<.=) :: MonadState s m => Traversal s s a b -> b -> m b

anyOf :: Getting Any s a -> (a -> Bool) -> s -> Bool Source #

Returns `True` if any target of a `Fold` satisfies a predicate.

    >>> anyOf both (=='x') ('x','y')
    True
    >>> import Data.Data.Lens
    >>> anyOf biplate (== "world") (((),2::Int),"hello",("world",11::Int))
    True

    any ≡ anyOf folded

    ianyOf l ≡ anyOf l . Indexed

    anyOf :: Getter s a     -> (a -> Bool) -> s -> Bool
    anyOf :: Fold s a       -> (a -> Bool) -> s -> Bool
    anyOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
    anyOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
    anyOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
    anyOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

ifoldMapOf :: IndexedGetting i m s a -> (i -> a -> m) -> s -> m Source #

Fold an `IndexedFold` or `IndexedTraversal` by mapping indices and values to an arbitrary `Monoid` with access to the `i`.

When you don't need access to the index then `foldMapOf` is more flexible in what it accepts.

    foldMapOf l ≡ ifoldMapOf l . const

    ifoldMapOf ::             IndexedGetter i s a     -> (i -> a -> m) -> s -> m
    ifoldMapOf :: Monoid m => IndexedFold i s a       -> (i -> a -> m) -> s -> m
    ifoldMapOf ::             IndexedLens' i s a      -> (i -> a -> m) -> s -> m
    ifoldMapOf :: Monoid m => IndexedTraversal' i s a -> (i -> a -> m) -> s -> m

dropping :: (Conjoined p, Applicative f) => Int -> Over p (Indexing f) s t a a -> Over p f s t a a Source #

Visit all but the first n targets of a `Traversal`, `Fold`, `Getter` or `Lens`.

    >>> ("hello","world") ^? dropping 1 both
    Just "world"

Dropping works on infinite traversals as well:

    >>> [1..] ^? dropping 1 folded
    Just 2

    dropping :: Int -> Traversal' s a                   -> Traversal' s a
    dropping :: Int -> Lens' s a                        -> Traversal' s a
    dropping :: Int -> Iso' s a                         -> Traversal' s a
    dropping :: Int -> Prism' s a                       -> Traversal' s a
    dropping :: Int -> Getter s a                       -> Fold s a
    dropping :: Int -> Fold s a                         -> Fold s a
    dropping :: Int -> IndexedTraversal' i s a          -> IndexedTraversal' i s a
    dropping :: Int -> IndexedLens' i s a               -> IndexedTraversal' i s a
    dropping :: Int -> IndexedGetter i s a              -> IndexedFold i s a
    dropping :: Int -> IndexedFold i s a                -> IndexedFold i s a

traverseOf :: LensLike f s t a b -> (a -> f b) -> s -> f t Source #

Map each element of a structure targeted by a `Lens` or `Traversal`, evaluate these actions from left to right, and collect the results.

This function is only provided for consistency, `id` is strictly more general.

    >>> traverseOf each print (1,2,3)
    1
    2
    3
    ((),(),())

    traverseOf ≡ id
    itraverseOf l ≡ traverseOf l . Indexed
    itraverseOf itraversed ≡ itraverse

This yields the obvious law:

    traverse ≡ traverseOf traverse

    traverseOf :: Functor f     => Iso s t a b        -> (a -> f b) -> s -> f t
    traverseOf :: Functor f     => Lens s t a b       -> (a -> f b) -> s -> f t
    traverseOf :: Apply f       => Traversal1 s t a b -> (a -> f b) -> s -> f t
    traverseOf :: Applicative f => Traversal s t a b  -> (a -> f b) -> s -> f t

_Left :: forall a c b p f. (Choice p, Applicative f) => p a (f b) -> p (Either a c) (f (Either b c)) Source #

This `Prism` provides a `Traversal` for tweaking the `Left` half of an `Either`:

    >>> over _Left (+1) (Left 2)
    Left 3

    >>> over _Left (+1) (Right 2)
    Right 2

    >>> Right 42 ^._Left :: String
    ""

    >>> Left "hello" ^._Left
    "hello"

It also can be turned around to obtain the embedding into the `Left` half of an `Either`:

    >>> _Left # 5
    Left 5

    >>> 5^.re _Left
    Left 5

forOf :: LensLike f s t a b -> s -> (a -> f b) -> f t Source #

A version of `traverseOf` with the arguments flipped, such that:

    >>> forOf each (1,2,3) print
    1
    2
    3
    ((),(),())

This function is only provided for consistency, `flip` is strictly more general.

    forOf ≡ flip
    forOf ≡ flip . traverseOf

    for ≡ forOf traverse
    ifor l s ≡ for l s . Indexed

    forOf :: Functor f => Iso s t a b -> s -> (a -> f b) -> f t
    forOf :: Functor f => Lens s t a b -> s -> (a -> f b) -> f t
    forOf :: Applicative f => Traversal s t a b -> s -> (a -> f b) -> f t

itraverseOf :: (Indexed i a (f b) -> s -> f t) -> (i -> a -> f b) -> s -> f t Source #

Traversal with an index.

NB: When you don't need access to the index then you can just apply your `IndexedTraversal` directly as a function!

    itraverseOf ≡ withIndex
    traverseOf l = itraverseOf l . const = id

    itraverseOf :: Functor f     => IndexedLens i s t a b       -> (i -> a -> f b) -> s -> f t
    itraverseOf :: Applicative f => IndexedTraversal i s t a b  -> (i -> a -> f b) -> s -> f t
    itraverseOf :: Apply f       => IndexedTraversal1 i s t a b -> (i -> a -> f b) -> s -> f t

imapMOf :: Over (Indexed i) (WrappedMonad m) s t a b -> (i -> a -> m b) -> s -> m t Source #

Map each element of a structure targeted by a `Lens` to a monadic action, evaluate these actions from left to right, and collect the results, with access its position.

When you don't need access to the index `mapMOf` is more liberal in what it can accept.

    mapMOf l ≡ imapMOf l . const

    imapMOf :: Monad m => IndexedLens       i s t a b -> (i -> a -> m b) -> s -> m t
    imapMOf :: Monad m => IndexedTraversal  i s t a b -> (i -> a -> m b) -> s -> m t
    imapMOf :: Bind  m => IndexedTraversal1 i s t a b -> (i -> a -> m b) -> s -> m t

iforMOf :: (Indexed i a (WrappedMonad m b) -> s -> WrappedMonad m t) -> s -> (i -> a -> m b) -> m t Source #

Map each element of a structure targeted by a `Lens` to a monadic action, evaluate these actions from left to right, and collect the results, with access its position (and the arguments flipped).

    forMOf l a ≡ iforMOf l a . const
    iforMOf ≡ flip . imapMOf

    iforMOf :: Monad m => IndexedLens i s t a b      -> s -> (i -> a -> m b) -> m t
    iforMOf :: Monad m => IndexedTraversal i s t a b -> s -> (i -> a -> m b) -> m t

ifor :: (TraversableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f (t b) #

contextsOf :: ATraversal' a a -> a -> [Context a a a] Source #

Return a list of all of the editable contexts for every location in the structure, recursively, using a user-specified `Traversal` to walk each layer.

    propUniverse l x = universeOf l x == map pos (contextsOf l x)
    propId l x = all (== x) [extract w | w <- contextsOf l x]

    contextsOf :: Traversal' a a -> a -> [Context a a a]

ala :: (Functor f, Rewrapping s t) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s) Source #

This combinator is based on `ala` from Conor McBride's work on Epigram.

As with `_Wrapping`, the user supplied function for the newtype is ignored.

    >>> ala Sum foldMap [1,2,3,4]
    10

    >>> ala All foldMap [True,True]
    True

    >>> ala All foldMap [True,False]
    False

    >>> ala Any foldMap [False,False]
    False

    >>> ala Any foldMap [True,False]
    True

    >>> ala Product foldMap [1,2,3,4]
    24

You may want to think of this combinator as having the following, simpler, type.

    ala :: Rewrapping s t => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> e -> s) -> e -> Unwrapped s

alaf :: (Functor f, Functor g, Rewrapping s t) => (Unwrapped s -> s) -> (f t -> g s) -> f (Unwrapped t) -> g (Unwrapped s) Source #

This combinator is based on `ala'` from Conor McBride's work on Epigram.

As with `_Wrapping`, the user supplied function for the newtype is ignored.

    alaf :: Rewrapping s t => (Unwrapped s -> s) -> ((r -> t) -> e -> s) -> (r -> Unwrapped t) -> e -> Unwrapped s

    >>> alaf Sum foldMap Prelude.length ["hello","world"]
    10

folded :: forall (f :: Type -> Type) a. Foldable f => IndexedFold Int (f a) a Source #

Obtain a `Fold` from any `Foldable` indexed by ordinal position.

    >>> Just 3^..folded
    [3]

    >>> Nothing^..folded
    []

    >>> [(1,2),(3,4)]^..folded.both
    [1,2,3,4]

alongside :: LensLike (AlongsideLeft f b') s t a b -> LensLike (AlongsideRight f t) s' t' a' b' -> LensLike f (s, s') (t, t') (a, a') (b, b') Source #

`alongside` makes a `Lens` from two other lenses or a `Getter` from two other getters by executing them on their respective halves of a product.

    >>> (Left a, Right b)^.alongside chosen chosen
    (a,b)

    >>> (Left a, Right b) & alongside chosen chosen .~ (c,d)
    (Left c,Right d)

    alongside :: Lens   s t a b -> Lens   s' t' a' b' -> Lens   (s,s') (t,t') (a,a') (b,b')
    alongside :: Getter s   a   -> Getter s'    a'    -> Getter (s,s')        (a,a')

without :: APrism s t a b -> APrism u v c d -> Prism (Either s u) (Either t v) (Either a c) (Either b d) Source #

Given a pair of prisms, project sums.

Viewing a `Prism` as a co-`Lens`, this combinator can be seen to be dual to `alongside`.

failing :: (Conjoined p, Applicative f) => Traversing p f s t a b -> Over p f s t a b -> Over p f s t a b infixl 5 Source #

Try the first `Traversal` (or `Fold`), falling back on the second `Traversal` (or `Fold`) if it returns no entries.

This is only a valid `Traversal` if the second `Traversal` is disjoint from the result of the first or returns exactly the same results. These conditions are trivially met when given a `Lens`, `Iso`, `Getter`, `Prism` or "affine" Traversal -- one that has 0 or 1 target.

Mutatis mutandis for `Fold`.

    >>> [0,1,2,3] ^? failing (ix 1) (ix 2)
    Just 1

    >>> [0,1,2,3] ^? failing (ix 42) (ix 2)
    Just 2

    failing :: Traversal s t a b -> Traversal s t a b -> Traversal s t a b
    failing :: Prism s t a b     -> Prism s t a b     -> Traversal s t a b
    failing :: Fold s a          -> Fold s a          -> Fold s a

These cases are also supported, trivially, but are boring, because the left hand side always succeeds.

    failing :: Lens s t a b      -> Traversal s t a b -> Traversal s t a b
    failing :: Iso s t a b       -> Traversal s t a b -> Traversal s t a b
    failing :: Equality s t a b  -> Traversal s t a b -> Traversal s t a b
    failing :: Getter s a        -> Fold s a          -> Fold s a

If both of the inputs are indexed, the result is also indexed, so you can apply this to a pair of indexed traversals or indexed folds, obtaining an indexed traversal or indexed fold.

    failing :: IndexedTraversal i s t a b -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b
    failing :: IndexedFold i s a          -> IndexedFold i s a          -> IndexedFold i s a

These cases are also supported, trivially, but are boring, because the left hand side always succeeds.

    failing :: IndexedLens i s t a b      -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b
    failing :: IndexedGetter i s a        -> IndexedGetter i s a        -> IndexedFold i s a

imapM :: (TraversableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m (t b) #

iforM :: (TraversableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m (t b) #

imapAccumR :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) #

imapAccumL :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) #

iany :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

iall :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

inone :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

itraverse_ :: (FoldableWithIndex i t, Applicative f) => (i -> a -> f b) -> t a -> f () #

ifor_ :: (FoldableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f () #

imapM_ :: (FoldableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m () #

iforM_ :: (FoldableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m () #

iconcatMap :: FoldableWithIndex i f => (i -> a -> [b]) -> f a -> [b] #

ifind :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Maybe (i, a) #

ifoldrM :: (FoldableWithIndex i f, Monad m) => (i -> a -> b -> m b) -> b -> f a -> m b #

ifoldlM :: (FoldableWithIndex i f, Monad m) => (i -> b -> a -> m b) -> b -> f a -> m b #

itoList :: FoldableWithIndex i f => f a -> [(i, a)] #

foldBy :: Foldable t => (a -> a -> a) -> a -> t a -> a #

foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r #

traverseBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> t a -> f (t b) #

sequenceBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> t (f a) -> f (t a) #

indexing :: Indexable Int p => ((a -> Indexing f b) -> s -> Indexing f t) -> p a (f b) -> s -> f t Source #

Transform a `Traversal` into an `IndexedTraversal` or a `Fold` into an `IndexedFold`, etc.

    indexing :: Traversal s t a b -> IndexedTraversal Int s t a b
    indexing :: Prism s t a b     -> IndexedTraversal Int s t a b
    indexing :: Lens s t a b      -> IndexedLens Int  s t a b
    indexing :: Iso s t a b       -> IndexedLens Int s t a b
    indexing :: Fold s a          -> IndexedFold Int s a
    indexing :: Getter s a        -> IndexedGetter Int s a

    indexing :: Indexable Int p => LensLike (Indexing f) s t a b -> Over p f s t a b

indexing64 :: Indexable Int64 p => ((a -> Indexing64 f b) -> s -> Indexing64 f t) -> p a (f b) -> s -> f t Source #

Transform a `Traversal` into an `IndexedTraversal` or a `Fold` into an `IndexedFold`, etc.

This combinator is like `indexing` except that it handles large traversals and folds gracefully.

    indexing64 :: Traversal s t a b -> IndexedTraversal Int64 s t a b
    indexing64 :: Prism s t a b     -> IndexedTraversal Int64 s t a b
    indexing64 :: Lens s t a b      -> IndexedLens Int64 s t a b
    indexing64 :: Iso s t a b       -> IndexedLens Int64 s t a b
    indexing64 :: Fold s a          -> IndexedFold Int64 s a
    indexing64 :: Getter s a        -> IndexedGetter Int64 s a

    indexing64 :: Indexable Int64 p => LensLike (Indexing64 f) s t a b -> Over p f s t a b

asIndex :: (Indexable i p, Contravariant f, Functor f) => p i (f i) -> Indexed i s (f s) Source #

When composed with an `IndexedFold` or `IndexedTraversal` this yields an (`Indexed`) `Fold` of the indices.

retagged :: (Profunctor p, Bifunctor p) => p a b -> p s b Source #

This is a profunctor used internally to implement Review

It plays a role similar to that of `Accessor` or `Const` do for Control.Lens.Getter

mapped :: forall (f :: Type -> Type) a b. Functor f => Setter (f a) (f b) a b Source #

This `Setter` can be used to map over all of the values in a `Functor`.

    fmap ≡ over mapped
    fmapDefault ≡ over traverse
    (<$) ≡ set mapped

    >>> over mapped f [a,b,c]
    [f a,f b,f c]

    >>> over mapped (+1) [1,2,3]
    [2,3,4]

    >>> set mapped x [a,b,c]
    [x,x,x]

    >>> [[a,b],[c]] & mapped.mapped +~ x
    [[a + x,b + x],[c + x]]

    >>> over (mapped._2) length [("hello","world"),("leaders","!!!")]
    [("hello",5),("leaders",3)]

    mapped :: Functor f => Setter (f a) (f b) a b

If you want an `IndexPreservingSetter` use ``setting` `fmap``.

lifted :: forall (m :: Type -> Type) a b. Monad m => Setter (m a) (m b) a b Source #

This `setter` can be used to modify all of the values in a `Monad`.

You sometimes have to use this rather than `mapped` -- due to temporary insanity `Functor` was not a superclass of `Monad` until GHC 7.10.

    liftM ≡ over lifted

    >>> over lifted f [a,b,c]
    [f a,f b,f c]

    >>> set lifted b (Just a)
    Just b

If you want an `IndexPreservingSetter` use ``setting` `liftM``.

contramapped :: forall (f :: Type -> Type) b a. Contravariant f => Setter (f b) (f a) a b Source #

This `Setter` can be used to map over all of the inputs to a `Contravariant`.

    contramap ≡ over contramapped

    >>> getPredicate (over contramapped (*2) (Predicate even)) 5
    True

    >>> getOp (over contramapped (*5) (Op show)) 100
    "500"

    >>> Prelude.map ($ 1) $ over (mapped . _Unwrapping' Op . contramapped) (*12) [(*2),(+1),(^3)]
    [24,13,1728]

setting :: ((a -> b) -> s -> t) -> IndexPreservingSetter s t a b Source #

Build an index-preserving `Setter` from a map-like function.

Your supplied function `f` is required to satisfy:

    f id ≡ id
    f g . f h ≡ f (g . h)

Equational reasoning:

    setting . over ≡ id
    over . setting ≡ id

Another way to view `sets` is that it takes a "semantic editor combinator" and transforms it into a `Setter`.

    setting :: ((a -> b) -> s -> t) -> Setter s t a b

sets :: (Profunctor p, Profunctor q, Settable f) => (p a b -> q s t) -> Optical p q f s t a b Source #

Build a `Setter`, `IndexedSetter` or `IndexPreservingSetter` depending on your choice of `Profunctor`.

    sets :: ((a -> b) -> s -> t) -> Setter s t a b

cloneSetter :: ASetter s t a b -> Setter s t a b Source #

Restore `ASetter` to a full `Setter`.

cloneIndexPreservingSetter :: ASetter s t a b -> IndexPreservingSetter s t a b Source #

Build an `IndexPreservingSetter` from any `Setter`.

cloneIndexedSetter :: AnIndexedSetter i s t a b -> IndexedSetter i s t a b Source #

Clone an `IndexedSetter`.

set' :: ASetter' s a -> a -> s -> s Source #

Replace the target of a `Lens` or all of the targets of a `Setter'` or `Traversal` with a constant value, without changing its type.

This is a type restricted version of `set`, which retains the type of the original.

    >>> set' mapped x [a,b,c,d]
    [x,x,x,x]

    >>> set' _2 "hello" (1,"world")
    (1,"hello")

    >>> set' mapped 0 [1,2,3,4]
    [0,0,0,0]

Note: Attempting to adjust `set'` a `Fold` or `Getter` will fail at compile time with an relatively nice error message.

    set' :: Setter' s a    -> a -> s -> s
    set' :: Iso' s a       -> a -> s -> s
    set' :: Lens' s a      -> a -> s -> s
    set' :: Traversal' s a -> a -> s -> s

(<?~) :: ASetter s t a (Maybe b) -> b -> s -> (b, t) infixr 4 Source #

Set to `Just` a value with pass-through.

This is mostly present for consistency, but may be useful for for chaining assignments.

If you do not need a copy of the intermediate result, then using `l `?~` d` directly is a good idea.

    >>> import qualified Data.Map as Map
    >>> _2.at "hello" <?~ "world" $ (42,Map.fromList [("goodnight","gracie")])
    ("world",(42,fromList [("goodnight","gracie"),("hello","world")]))

    (<?~) :: Setter s t a (Maybe b)    -> b -> s -> (b, t)
    (<?~) :: Iso s t a (Maybe b)       -> b -> s -> (b, t)
    (<?~) :: Lens s t a (Maybe b)      -> b -> s -> (b, t)
    (<?~) :: Traversal s t a (Maybe b) -> b -> s -> (b, t)

assign :: MonadState s m => ASetter s s a b -> b -> m () Source #

Replace the target of a `Lens` or all of the targets of a `Setter` or `Traversal` in our monadic state with a new value, irrespective of the old.

This is an alias for (`.=`).

    >>> execState (do assign _1 c; assign _2 d) (a,b)
    (c,d)

    >>> execState (both .= c) (a,b)
    (c,c)

    assign :: MonadState s m => Iso' s a       -> a -> m ()
    assign :: MonadState s m => Lens' s a      -> a -> m ()
    assign :: MonadState s m => Traversal' s a -> a -> m ()
    assign :: MonadState s m => Setter' s a    -> a -> m ()

modifying :: MonadState s m => ASetter s s a b -> (a -> b) -> m () Source #

This is an alias for (`%=`).

(<~) :: MonadState s m => ASetter s s a b -> m b -> m () infixr 2 Source #

Run a monadic action, and set all of the targets of a `Lens`, `Setter` or `Traversal` to its result.

    (<~) :: MonadState s m => Iso s s a b       -> m b -> m ()
    (<~) :: MonadState s m => Lens s s a b      -> m b -> m ()
    (<~) :: MonadState s m => Traversal s s a b -> m b -> m ()
    (<~) :: MonadState s m => Setter s s a b    -> m b -> m ()

As a reasonable mnemonic, this lets you store the result of a monadic action in a `Lens` rather than in a local variable.

    do foo <- bar
       ...

will store the result in a variable, while

    do foo <~ bar
       ...

will store the result in a `Lens`, `Setter`, or `Traversal`.

(<?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m b infix 4 Source #

Set `Just` a value with pass-through

This is useful for chaining assignment without round-tripping through your `Monad` stack.

    do x <- at "foo" <?= ninety_nine_bottles_of_beer_on_the_wall

If you do not need a copy of the intermediate result, then using `l `?=` d` will avoid unused binding warnings.

    (<?=) :: MonadState s m => Setter s s a (Maybe b)    -> b -> m b
    (<?=) :: MonadState s m => Iso s s a (Maybe b)       -> b -> m b
    (<?=) :: MonadState s m => Lens s s a (Maybe b)      -> b -> m b
    (<?=) :: MonadState s m => Traversal s s a (Maybe b) -> b -> m b

scribe :: (MonadWriter t m, Monoid s) => ASetter s t a b -> b -> m () Source #

Write to a fragment of a larger `Writer` format.

passing :: MonadWriter w m => Setter w w u v -> m (a, u -> v) -> m a Source #

This is a generalization of `pass` that allows you to modify just a portion of the resulting `MonadWriter`.

ipassing :: MonadWriter w m => IndexedSetter i w w u v -> m (a, i -> u -> v) -> m a Source #

This is a generalization of `pass` that allows you to modify just a portion of the resulting `MonadWriter` with access to the index of an `IndexedSetter`.

censoring :: MonadWriter w m => Setter w w u v -> (u -> v) -> m a -> m a Source #

This is a generalization of `censor` that allows you to `censor` just a portion of the resulting `MonadWriter`.

icensoring :: MonadWriter w m => IndexedSetter i w w u v -> (i -> u -> v) -> m a -> m a Source #

This is a generalization of `censor` that allows you to `censor` just a portion of the resulting `MonadWriter`, with access to the index of an `IndexedSetter`.

locally :: MonadReader s m => ASetter s s a b -> (a -> b) -> m r -> m r Source #

Modify the value of the `Reader` environment associated with the target of a `Setter`, `Lens`, or `Traversal`.

    locally l id a ≡ a
    locally l f . locally l g ≡ locally l (f . g)

    >>> (1,1) & locally _1 (+1) (uncurry (+))
    3

    >>> "," & locally ($) ("Hello" <>) (<> " world!")
    "Hello, world!"

    locally :: MonadReader s m => Iso s s a b       -> (a -> b) -> m r -> m r
    locally :: MonadReader s m => Lens s s a b      -> (a -> b) -> m r -> m r
    locally :: MonadReader s m => Traversal s s a b -> (a -> b) -> m r -> m r
    locally :: MonadReader s m => Setter s s a b    -> (a -> b) -> m r -> m r

ilocally :: MonadReader s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m r -> m r Source #

This is a generalization of `locally` that allows one to make indexed `local` changes to a `Reader` environment associated with the target of a `Setter`, `Lens`, or `Traversal`.

    locally l f ≡ ilocally l f . const
    ilocally l f ≡ locally l f . Indexed

    ilocally :: MonadReader s m => IndexedLens s s a b      -> (i -> a -> b) -> m r -> m r
    ilocally :: MonadReader s m => IndexedTraversal s s a b -> (i -> a -> b) -> m r -> m r
    ilocally :: MonadReader s m => IndexedSetter s s a b    -> (i -> a -> b) -> m r -> m r

iover :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t Source #

Map with index. This is an alias for `imapOf`.

When you do not need access to the index, then `over` is more liberal in what it can accept.

    over l ≡ iover l . const
    iover l ≡ over l . Indexed

    iover :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
    iover :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
    iover :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

iset :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t Source #

Set with index. Equivalent to `iover` with the current value ignored.

When you do not need access to the index, then `set` is more liberal in what it can accept.

    set l ≡ iset l . const

    iset :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
    iset :: IndexedLens i s t a b      -> (i -> b) -> s -> t
    iset :: IndexedTraversal i s t a b -> (i -> b) -> s -> t

isets :: ((i -> a -> b) -> s -> t) -> IndexedSetter i s t a b Source #

Build an `IndexedSetter` from an `imap`-like function.

Your supplied function `f` is required to satisfy:

    f id ≡ id
    f g . f h ≡ f (g . h)

Equational reasoning:

    isets . iover ≡ id
    iover . isets ≡ id

Another way to view `isets` is that it takes a "semantic editor combinator" which has been modified to carry an index and transforms it into a `IndexedSetter`.

(.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t infixr 4 Source #

Replace every target of an `IndexedSetter`, `IndexedLens` or `IndexedTraversal` with access to the index.

    (.@~) ≡ iset

When you do not need access to the index then (`.~`) is more liberal in what it can accept.

    l .~ b ≡ l .@~ const b

    (.@~) :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
    (.@~) :: IndexedLens i s t a b      -> (i -> b) -> s -> t
    (.@~) :: IndexedTraversal i s t a b -> (i -> b) -> s -> t

(%@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () infix 4 Source #

Adjust every target in the current state of an `IndexedSetter`, `IndexedLens` or `IndexedTraversal` with access to the index.

When you do not need access to the index then (`%=`) is more liberal in what it can accept.

    l %= f ≡ l %@= const f

    (%@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> a -> b) -> m ()
    (%@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> a -> b) -> m ()
    (%@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> a -> b) -> m ()

imodifying :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () Source #

This is an alias for (`%@=`).

(.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m () infix 4 Source #

Replace every target in the current state of an `IndexedSetter`, `IndexedLens` or `IndexedTraversal` with access to the index.

When you do not need access to the index then (`.=`) is more liberal in what it can accept.

    l .= b ≡ l .@= const b

    (.@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> b) -> m ()
    (.@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> b) -> m ()
    (.@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> b) -> m ()

assignA :: Arrow p => ASetter s t a b -> p s b -> p s t Source #

Run an arrow command and use the output to set all the targets of a `Lens`, `Setter` or `Traversal` to the result.

`assignA` can be used very similarly to (`<~`), except that the type of the object being modified can change; for example:

    runKleisli action ((), (), ()) where
      action =      assignA _1 (Kleisli (const getVal1))
               >>> assignA _2 (Kleisli (const getVal2))
               >>> assignA _3 (Kleisli (const getVal3))
      getVal1 :: Either String Int
      getVal1 = ...
      getVal2 :: Either String Bool
      getVal2 = ...
      getVal3 :: Either String Char
      getVal3 = ...

has the type ``Either` `String` (`Int`, `Bool`, `Char`)`

    assignA :: Arrow p => Iso s t a b       -> p s b -> p s t
    assignA :: Arrow p => Lens s t a b      -> p s b -> p s t
    assignA :: Arrow p => Traversal s t a b -> p s b -> p s t
    assignA :: Arrow p => Setter s t a b    -> p s b -> p s t

mapOf :: ASetter s t a b -> (a -> b) -> s -> t Source #

`mapOf` is a deprecated alias for `over`.

imapOf :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t Source #

Map with index. (Deprecated alias for `iover`).

When you do not need access to the index, then `mapOf` is more liberal in what it can accept.

    mapOf l ≡ imapOf l . const

    imapOf :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
    imapOf :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
    imapOf :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

withLens :: forall s t a b (rep :: RuntimeRep) (r :: TYPE rep). ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r Source #

Obtain a getter and a setter from a lens, reversing `lens`.

iplens :: (s -> a) -> (s -> b -> t) -> IndexPreservingLens s t a b Source #

Build an index-preserving `Lens` from a `Getter` and a `Setter`.

ilens :: (s -> (i, a)) -> (s -> b -> t) -> IndexedLens i s t a b Source #

Build an `IndexedLens` from a `Getter` and a `Setter`.

(&~) :: s -> State s a -> s infixl 1 Source #

This can be used to chain lens operations using `op=` syntax rather than `op~` syntax for simple non-type-changing cases.

    >>> (10,20) & _1 .~ 30 & _2 .~ 40
    (30,40)

    >>> (10,20) &~ do _1 .= 30; _2 .= 40
    (30,40)

This does not support type-changing assignment, e.g.

    >>> (10,20) & _1 .~ "hello"
    ("hello",20)

(%%~) :: forall {k} f s (t :: k) a (b :: k). LensLike f s t a b -> (a -> f b) -> s -> f t infixr 4 Source #

(`%%~`) can be used in one of two scenarios:

When applied to a `Lens`, it can edit the target of the `Lens` in a structure, extracting a functorial result.

When applied to a `Traversal`, it can edit the targets of the traversals, extracting an applicative summary of its actions.

    >>> [66,97,116,109,97,110] & each %%~ \a -> ("na", chr a)
    ("nananananana","Batman")

For all that the definition of this combinator is just:

    (%%~) ≡ id

It may be beneficial to think about it as if it had these even more restricted types, however:

    (%%~) :: Functor f =>     Iso s t a b       -> (a -> f b) -> s -> f t
    (%%~) :: Functor f =>     Lens s t a b      -> (a -> f b) -> s -> f t
    (%%~) :: Applicative f => Traversal s t a b -> (a -> f b) -> s -> f t

When applied to a `Traversal`, it can edit the targets of the traversals, extracting a supplemental monoidal summary of its actions, by choosing `f = ((,) m)`

    (%%~) ::             Iso s t a b       -> (a -> (r, b)) -> s -> (r, t)
    (%%~) ::             Lens s t a b      -> (a -> (r, b)) -> s -> (r, t)
    (%%~) :: Monoid m => Traversal s t a b -> (a -> (m, b)) -> s -> (m, t)

(%%=) :: forall {k} s m p r (a :: k) b. MonadState s m => Over p ((,) r) s s a b -> p a (r, b) -> m r infix 4 Source #

Modify the target of a `Lens` in the current state returning some extra information of type `r` or modify all targets of a `Traversal` in the current state, extracting extra information of type `r` and return a monoidal summary of the changes.

    >>> runState (_1 %%= \x -> (f x, g x)) (a,b)
    (f a,(g a,b))

    (%%=) ≡ (state .)

It may be useful to think of (`%%=`), instead, as having either of the following more restricted type signatures:

    (%%=) :: MonadState s m             => Iso s s a b       -> (a -> (r, b)) -> m r
    (%%=) :: MonadState s m             => Lens s s a b      -> (a -> (r, b)) -> m r
    (%%=) :: (MonadState s m, Monoid r) => Traversal s s a b -> (a -> (r, b)) -> m r

(??) :: Functor f => f (a -> b) -> a -> f b infixl 1 Source #

This is convenient to `flip` argument order of composite functions defined as:

    fab ?? a = fmap ($ a) fab

For the `Functor` instance `f = ((->) r)` you can reason about this function as if the definition was `(`??`) ≡ `flip``:

    >>> (h ?? x) a
    h a x

    >>> execState ?? [] $ modify (1:)
    [1]

    >>> over _2 ?? ("hello","world") $ length
    ("hello",5)

    >>> over ?? length ?? ("hello","world") $ _2
    ("hello",5)

choosing :: Functor f => LensLike f s t a b -> LensLike f s' t' a b -> LensLike f (Either s s') (Either t t') a b Source #

Merge two lenses, getters, setters, folds or traversals.

    chosen ≡ choosing id id

    choosing :: Getter s a     -> Getter s' a     -> Getter (Either s s') a
    choosing :: Fold s a       -> Fold s' a       -> Fold (Either s s') a
    choosing :: Lens' s a      -> Lens' s' a      -> Lens' (Either s s') a
    choosing :: Traversal' s a -> Traversal' s' a -> Traversal' (Either s s') a
    choosing :: Setter' s a    -> Setter' s' a    -> Setter' (Either s s') a

chosen :: forall a b p f. (Conjoined p, Functor f) => p a (f b) -> p (Either a a) (f (Either b b)) Source #

This is a `Lens` that updates either side of an `Either`, where both sides have the same type.

    chosen ≡ choosing id id

    >>> Left a^.chosen
    a

    >>> Right a^.chosen
    a

    >>> Right "hello"^.chosen
    "hello"

    >>> Right a & chosen *~ b
    Right (a * b)

    chosen :: Lens (Either a a) (Either b b) a b
    chosen f (Left a)  = Left <$> f a
    chosen f (Right a) = Right <$> f a

locus :: forall (p :: Type -> Type -> Type -> Type) a c s b. IndexedComonadStore p => Lens (p a c s) (p b c s) a b Source #

This `Lens` lets you `view` the current `pos` of any indexed store comonad and `seek` to a new position. This reduces the API for working these instances to a single `Lens`.

    ipos w ≡ w ^. locus
    iseek s w ≡ w & locus .~ s
    iseeks f w ≡ w & locus %~ f

    locus :: Lens' (Context' a s) a
    locus :: Conjoined p => Lens' (Pretext' p a s) a
    locus :: Conjoined p => Lens' (PretextT' p g a s) a

cloneIndexPreservingLens :: ALens s t a b -> IndexPreservingLens s t a b Source #

Clone a `Lens` as an `IndexedPreservingLens` that just passes through whatever index is on any `IndexedLens`, `IndexedFold`, `IndexedGetter` or `IndexedTraversal` it is composed with.

cloneIndexedLens :: AnIndexedLens i s t a b -> IndexedLens i s t a b Source #

Clone an `IndexedLens` as an `IndexedLens` with the same index.

(<%~) :: LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t) infixr 4 Source #

Modify the target of a `Lens` and return the result.

When you do not need the result of the operation, (`%~`) is more flexible.

    (<%~) ::             Lens s t a b      -> (a -> b) -> s -> (b, t)
    (<%~) ::             Iso s t a b       -> (a -> b) -> s -> (b, t)
    (<%~) :: Monoid b => Traversal s t a b -> (a -> b) -> s -> (b, t)

(<+~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 Source #

Increment the target of a numerically valued `Lens` and return the result.

When you do not need the result of the addition, (`+~`) is more flexible.

    (<+~) :: Num a => Lens' s a -> a -> s -> (a, s)
    (<+~) :: Num a => Iso' s a  -> a -> s -> (a, s)

(<-~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 Source #

Decrement the target of a numerically valued `Lens` and return the result.

When you do not need the result of the subtraction, (`-~`) is more flexible.

    (<-~) :: Num a => Lens' s a -> a -> s -> (a, s)
    (<-~) :: Num a => Iso' s a  -> a -> s -> (a, s)

(<*~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 Source #

Multiply the target of a numerically valued `Lens` and return the result.

When you do not need the result of the multiplication, (`*~`) is more flexible.

    (<*~) :: Num a => Lens' s a -> a -> s -> (a, s)
    (<*~) :: Num a => Iso'  s a -> a -> s -> (a, s)

(<//~) :: Fractional a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 Source #

Divide the target of a fractionally valued `Lens` and return the result.

When you do not need the result of the division, (`//~`) is more flexible.

    (<//~) :: Fractional a => Lens' s a -> a -> s -> (a, s)
    (<//~) :: Fractional a => Iso'  s a -> a -> s -> (a, s)

(<^~) :: (Num a, Integral e) => LensLike ((,) a) s t a a -> e -> s -> (a, t) infixr 4 Source #

Raise the target of a numerically valued `Lens` to a non-negative `Integral` power and return the result.

When you do not need the result of the operation, (`^~`) is more flexible.

    (<^~) :: (Num a, Integral e) => Lens' s a -> e -> s -> (a, s)
    (<^~) :: (Num a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<^^~) :: (Fractional a, Integral e) => LensLike ((,) a) s t a a -> e -> s -> (a, t) infixr 4 Source #

Raise the target of a fractionally valued `Lens` to an `Integral` power and return the result.

When you do not need the result of the operation, (`^^~`) is more flexible.

    (<^^~) :: (Fractional a, Integral e) => Lens' s a -> e -> s -> (a, s)
    (<^^~) :: (Fractional a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<**~) :: Floating a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 Source #

Raise the target of a floating-point valued `Lens` to an arbitrary power and return the result.

When you do not need the result of the operation, (`**~`) is more flexible.

    (<**~) :: Floating a => Lens' s a -> a -> s -> (a, s)
    (<**~) :: Floating a => Iso' s a  -> a -> s -> (a, s)

(<||~) :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t) infixr 4 Source #

Logically `||` a Boolean valued `Lens` and return the result.

When you do not need the result of the operation, (`||~`) is more flexible.

    (<||~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
    (<||~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)

(<&&~) :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t) infixr 4 Source #

Logically `&&` a Boolean valued `Lens` and return the result.

When you do not need the result of the operation, (`&&~`) is more flexible.

    (<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
    (<&&~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)

(<<%~) :: LensLike ((,) a) s t a b -> (a -> b) -> s -> (a, t) infixr 4 Source #

Modify the target of a `Lens`, but return the old value.

When you do not need the old value, (`%~`) is more flexible.

    (<<%~) ::             Lens s t a b      -> (a -> b) -> s -> (a, t)
    (<<%~) ::             Iso s t a b       -> (a -> b) -> s -> (a, t)
    (<<%~) :: Monoid a => Traversal s t a b -> (a -> b) -> s -> (a, t)

(<<.~) :: LensLike ((,) a) s t a b -> b -> s -> (a, t) infixr 4 Source #

Replace the target of a `Lens`, but return the old value.

When you do not need the old value, (`.~`) is more flexible.

    (<<.~) ::             Lens s t a b      -> b -> s -> (a, t)
    (<<.~) ::             Iso s t a b       -> b -> s -> (a, t)
    (<<.~) :: Monoid a => Traversal s t a b -> b -> s -> (a, t)

(<<?~) :: LensLike ((,) a) s t a (Maybe b) -> b -> s -> (a, t) infixr 4 Source #

Replace the target of a `Lens` with a `Just` value, but return the old value.

If you do not need the old value (`?~`) is more flexible.

    >>> import qualified Data.Map as Map
    >>> _2.at "hello" <<?~ "world" $ (42,Map.fromList [("goodnight","gracie")])
    (Nothing,(42,fromList [("goodnight","gracie"),("hello","world")]))

    (<<?~) :: Iso s t a (Maybe b)       -> b -> s -> (a, t)
    (<<?~) :: Lens s t a (Maybe b)      -> b -> s -> (a, t)
    (<<?~) :: Traversal s t a (Maybe b) -> b -> s -> (a, t)

(<<+~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 Source #

Increment the target of a numerically valued `Lens` and return the old value.

When you do not need the old value, (`+~`) is more flexible.

    >>> (a,b) & _1 <<+~ c
    (a,(a + c,b))

    >>> (a,b) & _2 <<+~ c
    (b,(a,b + c))

    (<<+~) :: Num a => Lens' s a -> a -> s -> (a, s)
    (<<+~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<-~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 Source #

Decrement the target of a numerically valued `Lens` and return the old value.

When you do not need the old value, (`-~`) is more flexible.

    >>> (a,b) & _1 <<-~ c
    (a,(a - c,b))

    >>> (a,b) & _2 <<-~ c
    (b,(a,b - c))

    (<<-~) :: Num a => Lens' s a -> a -> s -> (a, s)
    (<<-~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<*~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 Source #

Multiply the target of a numerically valued `Lens` and return the old value.

When you do not need the old value, (`-~`) is more flexible.

    >>> (a,b) & _1 <<*~ c
    (a,(a * c,b))

    >>> (a,b) & _2 <<*~ c
    (b,(a,b * c))

    (<<*~) :: Num a => Lens' s a -> a -> s -> (a, s)
    (<<*~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<//~) :: Fractional a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 Source #

Divide the target of a numerically valued `Lens` and return the old value.

When you do not need the old value, (`//~`) is more flexible.

    >>> (a,b) & _1 <<//~ c
    (a,(a / c,b))

    >>> ("Hawaii",10) & _2 <<//~ 2
    (10.0,("Hawaii",5.0))

    (<<//~) :: Fractional a => Lens' s a -> a -> s -> (a, s)
    (<<//~) :: Fractional a => Iso' s a -> a -> s -> (a, s)

(<<^~) :: (Num a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s) infixr 4 Source #

Raise the target of a numerically valued `Lens` to a non-negative power and return the old value.

When you do not need the old value, (`^~`) is more flexible.

    (<<^~) :: (Num a, Integral e) => Lens' s a -> e -> s -> (a, s)
    (<<^~) :: (Num a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<<^^~) :: (Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s) infixr 4 Source #

Raise the target of a fractionally valued `Lens` to an integral power and return the old value.

When you do not need the old value, (`^^~`) is more flexible.

    (<<^^~) :: (Fractional a, Integral e) => Lens' s a -> e -> s -> (a, s)
    (<<^^~) :: (Fractional a, Integral e) => Iso' s a -> e -> S -> (a, s)

(<<**~) :: Floating a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 Source #

Raise the target of a floating-point valued `Lens` to an arbitrary power and return the old value.

When you do not need the old value, (`**~`) is more flexible.

    >>> (a,b) & _1 <<**~ c
    (a,(a**c,b))

    >>> (a,b) & _2 <<**~ c
    (b,(a,b**c))

    (<<**~) :: Floating a => Lens' s a -> a -> s -> (a, s)
    (<<**~) :: Floating a => Iso' s a -> a -> s -> (a, s)

(<<||~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s) infixr 4 Source #

Logically `||` the target of a `Bool`-valued `Lens` and return the old value.

When you do not need the old value, (`||~`) is more flexible.

    >>> (False,6) & _1 <<||~ True
    (False,(True,6))

    >>> ("hello",True) & _2 <<||~ False
    (True,("hello",True))

    (<<||~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
    (<<||~) :: Iso' s Bool -> Bool -> s -> (Bool, s)

(<<&&~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s) infixr 4 Source #

Logically `&&` the target of a `Bool`-valued `Lens` and return the old value.

When you do not need the old value, (`&&~`) is more flexible.

    >>> (False,6) & _1 <<&&~ True
    (False,(False,6))

    >>> ("hello",True) & _2 <<&&~ False
    (True,("hello",False))

    (<<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
    (<<&&~) :: Iso' s Bool -> Bool -> s -> (Bool, s)

(<<<>~) :: Semigroup r => LensLike' ((,) r) s r -> r -> s -> (r, s) infixr 4 Source #

Modify the target of a monoidally valued `Lens` by using (`<>`) a new value and return the old value.

When you do not need the old value, (`<>~`) is more flexible.

    >>> (Sum a,b) & _1 <<<>~ Sum c
    (Sum {getSum = a},(Sum {getSum = a + c},b))

    >>> _2 <<<>~ ", 007" $ ("James", "Bond")
    ("Bond",("James","Bond, 007"))

    (<<<>~) :: Semigroup r => Lens' s r -> r -> s -> (r, s)
    (<<<>~) :: Semigroup r => Iso' s r -> r -> s -> (r, s)

(<%=) :: MonadState s m => LensLike ((,) b) s s a b -> (a -> b) -> m b infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by a user supplied function and return the result.

When applied to a `Traversal`, it this will return a monoidal summary of all of the intermediate results.

When you do not need the result of the operation, (`%=`) is more flexible.

    (<%=) :: MonadState s m             => Lens' s a      -> (a -> a) -> m a
    (<%=) :: MonadState s m             => Iso' s a       -> (a -> a) -> m a
    (<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a

(<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Add to the target of a numerically valued `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the addition, (`+=`) is more flexible.

    (<+=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
    (<+=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Subtract from the target of a numerically valued `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the subtraction, (`-=`) is more flexible.

    (<-=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
    (<-=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Multiply the target of a numerically valued `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the multiplication, (`*=`) is more flexible.

    (<*=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
    (<*=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Divide the target of a fractionally valued `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the division, (`//=`) is more flexible.

    (<//=) :: (MonadState s m, Fractional a) => Lens' s a -> a -> m a
    (<//=) :: (MonadState s m, Fractional a) => Iso' s a -> a -> m a

(<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 Source #

Raise the target of a numerically valued `Lens` into your `Monad'`s state to a non-negative `Integral` power and return the result.

When you do not need the result of the operation, (`^=`) is more flexible.

    (<^=) :: (MonadState s m, Num a, Integral e) => Lens' s a -> e -> m a
    (<^=) :: (MonadState s m, Num a, Integral e) => Iso' s a -> e -> m a

(<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 Source #

Raise the target of a fractionally valued `Lens` into your `Monad'`s state to an `Integral` power and return the result.

When you do not need the result of the operation, (`^^=`) is more flexible.

    (<^^=) :: (MonadState s m, Fractional b, Integral e) => Lens' s a -> e -> m a
    (<^^=) :: (MonadState s m, Fractional b, Integral e) => Iso' s a  -> e -> m a

(<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Raise the target of a floating-point valued `Lens` into your `Monad'`s state to an arbitrary power and return the result.

When you do not need the result of the operation, (`**=`) is more flexible.

    (<**=) :: (MonadState s m, Floating a) => Lens' s a -> a -> m a
    (<**=) :: (MonadState s m, Floating a) => Iso' s a -> a -> m a

(<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 Source #

Logically `||` a Boolean valued `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the operation, (`||=`) is more flexible.

    (<||=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
    (<||=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool

(<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 Source #

Logically `&&` a Boolean valued `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the operation, (`&&=`) is more flexible.

    (<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
    (<&&=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool

(<<%=) :: (Strong p, MonadState s m) => Over p ((,) a) s s a b -> p a b -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by a user supplied function and return the old value that was replaced.

When applied to a `Traversal`, this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (`%=`) is more flexible.

    (<<%=) :: MonadState s m             => Lens' s a      -> (a -> a) -> m a
    (<<%=) :: MonadState s m             => Iso' s a       -> (a -> a) -> m a
    (<<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a

    (<<%=) :: MonadState s m => LensLike ((,)a) s s a b -> (a -> b) -> m a

(<<.=) :: MonadState s m => LensLike ((,) a) s s a b -> b -> m a infix 4 Source #

Replace the target of a `Lens` into your `Monad'`s state with a user supplied value and return the old value that was replaced.

When applied to a `Traversal`, this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (`.=`) is more flexible.

    (<<.=) :: MonadState s m             => Lens' s a      -> a -> m a
    (<<.=) :: MonadState s m             => Iso' s a       -> a -> m a
    (<<.=) :: (MonadState s m, Monoid a) => Traversal' s a -> a -> m a

(<<?=) :: MonadState s m => LensLike ((,) a) s s a (Maybe b) -> b -> m a infix 4 Source #

Replace the target of a `Lens` into your `Monad'`s state with `Just` a user supplied value and return the old value that was replaced.

When applied to a `Traversal`, this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (`?=`) is more flexible.

    (<<?=) :: MonadState s m             => Lens s t a (Maybe b)      -> b -> m a
    (<<?=) :: MonadState s m             => Iso s t a (Maybe b)       -> b -> m a
    (<<?=) :: (MonadState s m, Monoid a) => Traversal s t a (Maybe b) -> b -> m a

(<<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by adding a value and return the old value that was replaced.

When you do not need the result of the operation, (`+=`) is more flexible.

    (<<+=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
    (<<+=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by subtracting a value and return the old value that was replaced.

When you do not need the result of the operation, (`-=`) is more flexible.

    (<<-=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
    (<<-=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by multipling a value and return the old value that was replaced.

When you do not need the result of the operation, (`*=`) is more flexible.

    (<<*=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
    (<<*=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad`s state by dividing by a value and return the old value that was replaced.

When you do not need the result of the operation, (`//=`) is more flexible.

    (<<//=) :: (MonadState s m, Fractional a) => Lens' s a -> a -> m a
    (<<//=) :: (MonadState s m, Fractional a) => Iso' s a -> a -> m a

(<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by raising it by a non-negative power and return the old value that was replaced.

When you do not need the result of the operation, (`^=`) is more flexible.

    (<<^=) :: (MonadState s m, Num a, Integral e) => Lens' s a -> e -> m a
    (<<^=) :: (MonadState s m, Num a, Integral e) => Iso' s a -> a -> m a

(<<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by raising it by an integral power and return the old value that was replaced.

When you do not need the result of the operation, (`^^=`) is more flexible.

    (<<^^=) :: (MonadState s m, Fractional a, Integral e) => Lens' s a -> e -> m a
    (<<^^=) :: (MonadState s m, Fractional a, Integral e) => Iso' s a -> e -> m a

(<<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by raising it by an arbitrary power and return the old value that was replaced.

When you do not need the result of the operation, (`**=`) is more flexible.

    (<<**=) :: (MonadState s m, Floating a) => Lens' s a -> a -> m a
    (<<**=) :: (MonadState s m, Floating a) => Iso' s a -> a -> m a

(<<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by taking its logical `||` with a value and return the old value that was replaced.

When you do not need the result of the operation, (`||=`) is more flexible.

    (<<||=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
    (<<||=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool

(<<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by taking its logical `&&` with a value and return the old value that was replaced.

When you do not need the result of the operation, (`&&=`) is more flexible.

    (<<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
    (<<&&=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool

(<<<>=) :: (MonadState s m, Semigroup r) => LensLike' ((,) r) s r -> r -> m r infix 4 Source #

Modify the target of a `Lens` into your `Monad'`s state by using (`<>`) and return the old value that was replaced.

When you do not need the result of the operation, (`<>=`) is more flexible.

    (<<<>=) :: (MonadState s m, Semigroup r) => Lens' s r -> r -> m r
    (<<<>=) :: (MonadState s m, Semigroup r) => Iso' s r -> r -> m r

(<<~) :: MonadState s m => ALens s s a b -> m b -> m b infixr 2 Source #

Run a monadic action, and set the target of `Lens` to its result.

    (<<~) :: MonadState s m => Iso s s a b   -> m b -> m b
    (<<~) :: MonadState s m => Lens s s a b  -> m b -> m b

NB: This is limited to taking an actual `Lens` than admitting a `Traversal` because there are potential loss of state issues otherwise.

(<<>~) :: Semigroup m => LensLike ((,) m) s t m m -> m -> s -> (m, t) infixr 4 Source #

(`<>`) a `Semigroup` value onto the end of the target of a `Lens` and return the result.

When you do not need the result of the operation, (`<>~`) is more flexible.

(<<>=) :: (MonadState s m, Semigroup r) => LensLike' ((,) r) s r -> r -> m r infix 4 Source #

(`<>`) a `Semigroup` value onto the end of the target of a `Lens` into your `Monad'`s state and return the result.

When you do not need the result of the operation, (`<>=`) is more flexible.

overA :: Arrow ar => LensLike (Context a b) s t a b -> ar a b -> ar s t Source #

`over` for Arrows.

Unlike `over`, `overA` can't accept a simple `Setter`, but requires a full lens, or close enough.

    >>> overA _1 ((+1) *** (+2)) ((1,2),6)
    ((2,4),6)

    overA :: Arrow ar => Lens s t a b -> ar a b -> ar s t

(<%@~) :: Over (Indexed i) ((,) b) s t a b -> (i -> a -> b) -> s -> (b, t) infixr 4 Source #

Adjust the target of an `IndexedLens` returning the intermediate result, or adjust all of the targets of an `IndexedTraversal` and return a monoidal summary along with the answer.

    l <%~ f ≡ l <%@~ const f

When you do not need access to the index then (`<%~`) is more liberal in what it can accept.

If you do not need the intermediate result, you can use (`%@~`) or even (`%~`).

    (<%@~) ::             IndexedLens i s t a b      -> (i -> a -> b) -> s -> (b, t)
    (<%@~) :: Monoid b => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> (b, t)

(<<%@~) :: Over (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t) infixr 4 Source #

Adjust the target of an `IndexedLens` returning the old value, or adjust all of the targets of an `IndexedTraversal` and return a monoidal summary of the old values along with the answer.

    (<<%@~) ::             IndexedLens i s t a b      -> (i -> a -> b) -> s -> (a, t)
    (<<%@~) :: Monoid a => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> (a, t)

(%%@~) :: forall {k1} i f s (t :: k1) a (b :: k1). Over (Indexed i) f s t a b -> (i -> a -> f b) -> s -> f t infixr 4 Source #

Adjust the target of an `IndexedLens` returning a supplementary result, or adjust all of the targets of an `IndexedTraversal` and return a monoidal summary of the supplementary results and the answer.

    (%%@~) ≡ withIndex

    (%%@~) :: Functor f => IndexedLens i s t a b      -> (i -> a -> f b) -> s -> f t
    (%%@~) :: Applicative f => IndexedTraversal i s t a b -> (i -> a -> f b) -> s -> f t

In particular, it is often useful to think of this function as having one of these even more restricted type signatures:

    (%%@~) ::             IndexedLens i s t a b      -> (i -> a -> (r, b)) -> s -> (r, t)
    (%%@~) :: Monoid r => IndexedTraversal i s t a b -> (i -> a -> (r, b)) -> s -> (r, t)

(%%@=) :: MonadState s m => Over (Indexed i) ((,) r) s s a b -> (i -> a -> (r, b)) -> m r infix 4 Source #

Adjust the target of an `IndexedLens` returning a supplementary result, or adjust all of the targets of an `IndexedTraversal` within the current state, and return a monoidal summary of the supplementary results.

    l %%@= f ≡ state (l %%@~ f)

    (%%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> (r, b)) -> s -> m r
    (%%@=) :: (MonadState s m, Monoid r) => IndexedTraversal i s s a b -> (i -> a -> (r, b)) -> s -> m r

(<%@=) :: MonadState s m => Over (Indexed i) ((,) b) s s a b -> (i -> a -> b) -> m b infix 4 Source #

Adjust the target of an `IndexedLens` returning the intermediate result, or adjust all of the targets of an `IndexedTraversal` within the current state, and return a monoidal summary of the intermediate results.

    (<%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> b) -> m b
    (<%@=) :: (MonadState s m, Monoid b) => IndexedTraversal i s s a b -> (i -> a -> b) -> m b

(<<%@=) :: MonadState s m => Over (Indexed i) ((,) a) s s a b -> (i -> a -> b) -> m a infix 4 Source #

Adjust the target of an `IndexedLens` returning the old value, or adjust all of the targets of an `IndexedTraversal` within the current state, and return a monoidal summary of the old values.

    (<<%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> b) -> m a
    (<<%@=) :: (MonadState s m, Monoid b) => IndexedTraversal i s s a b -> (i -> a -> b) -> m a

(^#) :: s -> ALens s t a b -> a infixl 8 Source #

A version of (`^.`) that works on `ALens`.

    >>> ("hello","world")^#_2
    "world"

storing :: ALens s t a b -> b -> s -> t Source #

A version of `set` that works on `ALens`.

    >>> storing _2 "world" ("hello","there")
    ("hello","world")

(#~) :: ALens s t a b -> b -> s -> t infixr 4 Source #

A version of (`.~`) that works on `ALens`.

    >>> ("hello","there") & _2 #~ "world"
    ("hello","world")

(#%~) :: ALens s t a b -> (a -> b) -> s -> t infixr 4 Source #

A version of (`%~`) that works on `ALens`.

    >>> ("hello","world") & _2 #%~ length
    ("hello",5)

(#%%~) :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t infixr 4 Source #

A version of (`%%~`) that works on `ALens`.

    >>> ("hello","world") & _2 #%%~ \x -> (length x, x ++ "!")
    (5,("hello","world!"))

(#=) :: MonadState s m => ALens s s a b -> b -> m () infix 4 Source #

A version of (`.=`) that works on `ALens`.

(#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m () infix 4 Source #

A version of (`%=`) that works on `ALens`.

(<#%~) :: ALens s t a b -> (a -> b) -> s -> (b, t) infixr 4 Source #

A version of (`<%~`) that works on `ALens`.

    >>> ("hello","world") & _2 <#%~ length
    (5,("hello",5))

(<#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m b infix 4 Source #

A version of (`<%=`) that works on `ALens`.

(#%%=) :: MonadState s m => ALens s s a b -> (a -> (r, b)) -> m r infix 4 Source #

A version of (`%%=`) that works on `ALens`.

(<#~) :: ALens s t a b -> b -> s -> (b, t) infixr 4 Source #

A version of (`<.~`) that works on `ALens`.

    >>> ("hello","there") & _2 <#~ "world"
    ("world",("hello","world"))

(<#=) :: MonadState s m => ALens s s a b -> b -> m b infix 4 Source #

A version of (`<.=`) that works on `ALens`.

devoid :: forall {k} p f (a :: k) b. Over p f Void Void a b Source #

There is a field for every type in the `Void`. Very zen.

    >>> [] & mapped.devoid +~ 1
    []

    >>> Nothing & mapped.devoid %~ abs
    Nothing

    devoid :: Lens' Void a

united :: forall a f. Functor f => (() -> f ()) -> a -> f a Source #

We can always retrieve a `()` from any type.

    >>> "hello"^.united
    ()

    >>> "hello" & united .~ ()
    "hello"

head1 :: forall (t :: Type -> Type) a. Traversable1 t => Lens' (t a) a Source #

A `Lens` focusing on the first element of a `Traversable1` container.

    >>> 2 :| [3, 4] & head1 +~ 10
    12 :| [3,4]

    >>> Identity True ^. head1
    True

last1 :: forall (t :: Type -> Type) a. Traversable1 t => Lens' (t a) a Source #

A `Lens` focusing on the last element of a `Traversable1` container.

    >>> 2 :| [3, 4] & last1 +~ 10
    2 :| [3,14]

    >>> Node 'a' [Node 'b' [], Node 'c' []] ^. last1
    'c'

fusing :: Functor f => LensLike (Yoneda f) s t a b -> LensLike f s t a b Source #

Fuse a composition of lenses using `Yoneda` to provide `fmap` fusion.

In general, given a pair of lenses `foo` and `bar`

    fusing (foo.bar) = foo.bar

however, `foo` and `bar` are either going to `fmap` internally or they are trivial.

`fusing` exploits the `Yoneda` lemma to merge these separate uses into a single `fmap`.

This is particularly effective when the choice of functor `f` is unknown at compile time or when the `Lens` `foo.bar` in the above description is recursive or complex enough to prevent inlining.

    fusing :: Lens s t a b -> Lens s t a b

_1' :: Field1 s t a b => Lens s t a b Source #

Strict version of `_1`

_2' :: Field2 s t a b => Lens s t a b Source #

Strict version of `_2`

_3' :: Field3 s t a b => Lens s t a b Source #

Strict version of `_3`

_4' :: Field4 s t a b => Lens s t a b Source #

Strict version of `_4`

_5' :: Field5 s t a b => Lens s t a b Source #

Strict version of `_5`

_6' :: Field6 s t a b => Lens s t a b Source #

Strict version of `_6`

_7' :: Field7 s t a b => Lens s t a b Source #

Strict version of `_7`

_8' :: Field8 s t a b => Lens s t a b Source #

Strict version of `_8`

_9' :: Field9 s t a b => Lens s t a b Source #

Strict version of `_9`

_10' :: Field10 s t a b => Lens s t a b Source #

Strict version of `_10`

_11' :: Field11 s t a b => Lens s t a b Source #

Strict version of `_11`

_12' :: Field12 s t a b => Lens s t a b Source #

Strict version of `_12`

_13' :: Field13 s t a b => Lens s t a b Source #

Strict version of `_13`

_14' :: Field14 s t a b => Lens s t a b Source #

Strict version of `_14`

_15' :: Field15 s t a b => Lens s t a b Source #

Strict version of `_15`

_16' :: Field16 s t a b => Lens s t a b Source #

Strict version of `_16`

_17' :: Field17 s t a b => Lens s t a b Source #

Strict version of `_17`

_18' :: Field18 s t a b => Lens s t a b Source #

Strict version of `_18`

_19' :: Field19 s t a b => Lens s t a b Source #

Strict version of `_19`

ito :: (Indexable i p, Contravariant f) => (s -> (i, a)) -> Over' p f s a Source #

    ito :: (s -> (i, a)) -> IndexedGetter i s a

like :: (Profunctor p, Contravariant f, Functor f) => a -> Optic' p f s a Source #

Build an constant-valued (index-preserving) `Getter` from an arbitrary Haskell value.

    like a . like b ≡ like b
    a ^. like b ≡ b
    a ^. like b ≡ a ^. to (const b)

This can be useful as a second case `failing` a `Fold` e.g. `foo `failing` `like` 0`

    like :: a -> IndexPreservingGetter s a

ilike :: (Indexable i p, Contravariant f, Functor f) => i -> a -> Over' p f s a Source #

    ilike :: i -> a -> IndexedGetter i s a

views :: MonadReader s m => LensLike' (Const r :: Type -> Type) s a -> (a -> r) -> m r Source #

View a function of the value pointed to by a `Getter` or `Lens` or the result of folding over the result of mapping the targets of a `Fold` or `Traversal`.

    views l f ≡ view (l . to f)

    >>> views (to f) g a
    g (f a)

    >>> views _2 length (1,"hello")
    5

As `views` is commonly used to access the target of a `Getter` or obtain a monoidal summary of the targets of a `Fold`, It may be useful to think of it as having one of these more restricted signatures:

    views ::             Getter s a     -> (a -> r) -> s -> r
    views :: Monoid m => Fold s a       -> (a -> m) -> s -> m
    views ::             Iso' s a       -> (a -> r) -> s -> r
    views ::             Lens' s a      -> (a -> r) -> s -> r
    views :: Monoid m => Traversal' s a -> (a -> m) -> s -> m

In a more general setting, such as when working with a `Monad` transformer stack you can use:

    views :: MonadReader s m             => Getter s a     -> (a -> r) -> m r
    views :: (MonadReader s m, Monoid r) => Fold s a       -> (a -> r) -> m r
    views :: MonadReader s m             => Iso' s a       -> (a -> r) -> m r
    views :: MonadReader s m             => Lens' s a      -> (a -> r) -> m r
    views :: (MonadReader s m, Monoid r) => Traversal' s a -> (a -> r) -> m r

    views :: MonadReader s m => Getting r s a -> (a -> r) -> m r

uses :: MonadState s m => LensLike' (Const r :: Type -> Type) s a -> (a -> r) -> m r Source #

Use the target of a `Lens`, `Iso` or `Getter` in the current state, or use a summary of a `Fold` or `Traversal` that points to a monoidal value.

    >>> evalState (uses _1 length) ("hello","world")
    5

    uses :: MonadState s m             => Getter s a     -> (a -> r) -> m r
    uses :: (MonadState s m, Monoid r) => Fold s a       -> (a -> r) -> m r
    uses :: MonadState s m             => Lens' s a      -> (a -> r) -> m r
    uses :: MonadState s m             => Iso' s a       -> (a -> r) -> m r
    uses :: (MonadState s m, Monoid r) => Traversal' s a -> (a -> r) -> m r

    uses :: MonadState s m => Getting r s t a b -> (a -> r) -> m r

listening :: MonadWriter w m => Getting u w u -> m a -> m (a, u) Source #

This is a generalized form of `listen` that only extracts the portion of the log that is focused on by a `Getter`. If given a `Fold` or a `Traversal` then a monoidal summary of the parts of the log that are visited will be returned.

    listening :: MonadWriter w m             => Getter w u     -> m a -> m (a, u)
    listening :: MonadWriter w m             => Lens' w u      -> m a -> m (a, u)
    listening :: MonadWriter w m             => Iso' w u       -> m a -> m (a, u)
    listening :: (MonadWriter w m, Monoid u) => Fold w u       -> m a -> m (a, u)
    listening :: (MonadWriter w m, Monoid u) => Traversal' w u -> m a -> m (a, u)
    listening :: (MonadWriter w m, Monoid u) => Prism' w u     -> m a -> m (a, u)

ilistening :: MonadWriter w m => IndexedGetting i (i, u) w u -> m a -> m (a, (i, u)) Source #

This is a generalized form of `listen` that only extracts the portion of the log that is focused on by a `Getter`. If given a `Fold` or a `Traversal` then a monoidal summary of the parts of the log that are visited will be returned.

    ilistening :: MonadWriter w m             => IndexedGetter i w u     -> m a -> m (a, (i, u))
    ilistening :: MonadWriter w m             => IndexedLens' i w u      -> m a -> m (a, (i, u))
    ilistening :: (MonadWriter w m, Monoid u) => IndexedFold i w u       -> m a -> m (a, (i, u))
    ilistening :: (MonadWriter w m, Monoid u) => IndexedTraversal' i w u -> m a -> m (a, (i, u))

listenings :: MonadWriter w m => Getting v w u -> (u -> v) -> m a -> m (a, v) Source #

This is a generalized form of `listen` that only extracts the portion of the log that is focused on by a `Getter`. If given a `Fold` or a `Traversal` then a monoidal summary of the parts of the log that are visited will be returned.

    listenings :: MonadWriter w m             => Getter w u     -> (u -> v) -> m a -> m (a, v)
    listenings :: MonadWriter w m             => Lens' w u      -> (u -> v) -> m a -> m (a, v)
    listenings :: MonadWriter w m             => Iso' w u       -> (u -> v) -> m a -> m (a, v)
    listenings :: (MonadWriter w m, Monoid v) => Fold w u       -> (u -> v) -> m a -> m (a, v)
    listenings :: (MonadWriter w m, Monoid v) => Traversal' w u -> (u -> v) -> m a -> m (a, v)
    listenings :: (MonadWriter w m, Monoid v) => Prism' w u     -> (u -> v) -> m a -> m (a, v)

ilistenings :: MonadWriter w m => IndexedGetting i v w u -> (i -> u -> v) -> m a -> m (a, v) Source #

This is a generalized form of `listen` that only extracts the portion of the log that is focused on by a `Getter`. If given a `Fold` or a `Traversal` then a monoidal summary of the parts of the log that are visited will be returned.

    ilistenings :: MonadWriter w m             => IndexedGetter w u     -> (i -> u -> v) -> m a -> m (a, v)
    ilistenings :: MonadWriter w m             => IndexedLens' w u      -> (i -> u -> v) -> m a -> m (a, v)
    ilistenings :: (MonadWriter w m, Monoid v) => IndexedFold w u       -> (i -> u -> v) -> m a -> m (a, v)
    ilistenings :: (MonadWriter w m, Monoid v) => IndexedTraversal' w u -> (i -> u -> v) -> m a -> m (a, v)

iview :: MonadReader s m => IndexedGetting i (i, a) s a -> m (i, a) Source #

View the index and value of an `IndexedGetter` into the current environment as a pair.

When applied to an `IndexedFold` the result will most likely be a nonsensical monoidal summary of the indices tupled with a monoidal summary of the values and probably not whatever it is you wanted.

iviews :: MonadReader s m => IndexedGetting i r s a -> (i -> a -> r) -> m r Source #

View a function of the index and value of an `IndexedGetter` into the current environment.

When applied to an `IndexedFold` the result will be a monoidal summary instead of a single answer.

    iviews ≡ ifoldMapOf

iuse :: MonadState s m => IndexedGetting i (i, a) s a -> m (i, a) Source #

Use the index and value of an `IndexedGetter` into the current state as a pair.

When applied to an `IndexedFold` the result will most likely be a nonsensical monoidal summary of the indices tupled with a monoidal summary of the values and probably not whatever it is you wanted.

iuses :: MonadState s m => IndexedGetting i r s a -> (i -> a -> r) -> m r Source #

Use a function of the index and value of an `IndexedGetter` into the current state.

When applied to an `IndexedFold` the result will be a monoidal summary instead of a single answer.

(^@.) :: s -> IndexedGetting i (i, a) s a -> (i, a) infixl 8 Source #

View the index and value of an `IndexedGetter` or `IndexedLens`.

This is the same operation as `iview` with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (`.`).

    (^@.) :: s -> IndexedGetter i s a -> (i, a)
    (^@.) :: s -> IndexedLens' i s a  -> (i, a)

The result probably doesn't have much meaning when applied to an `IndexedFold`.

getting :: (Profunctor p, Profunctor q, Functor f, Contravariant f) => Optical p q f s t a b -> Optical' p q f s a Source #

Coerce a `Getter`-compatible `Optical` to an `Optical'`. This is useful when using a `Traversal` that is not simple as a `Getter` or a `Fold`.

    getting :: Traversal s t a b          -> Fold s a
    getting :: Lens s t a b               -> Getter s a
    getting :: IndexedTraversal i s t a b -> IndexedFold i s a
    getting :: IndexedLens i s t a b      -> IndexedGetter i s a

unto :: (Profunctor p, Bifunctor p, Functor f) => (b -> t) -> Optic p f s t a b Source #

An analogue of `to` for `review`.

    unto :: (b -> t) -> Review' t b

    unto = un . to

un :: (Profunctor p, Bifunctor p, Functor f) => Getting a s a -> Optic' p f a s Source #

Turn a `Getter` around to get a `Review`

    un = unto . view
    unto = un . to

    >>> un (to length) # [1,2,3]
    3

reviews :: MonadReader b m => AReview t b -> (t -> r) -> m r Source #

This can be used to turn an `Iso` or `Prism` around and `view` a value (or the current environment) through it the other way, applying a function.

    reviews ≡ views . re
    reviews (unto f) g ≡ g . f

    >>> reviews _Left isRight "mustard"
    False

    >>> reviews (unto succ) (*2) 3
    8

Usually this function is used in the `(->)` `Monad` with a `Prism` or `Iso`, in which case it may be useful to think of it as having one of these more restricted type signatures:

    reviews :: Iso' s a   -> (s -> r) -> a -> r
    reviews :: Prism' s a -> (s -> r) -> a -> r

However, when working with a `Monad` transformer stack, it is sometimes useful to be able to `review` the current environment, in which case it may be beneficial to think of it as having one of these slightly more liberal type signatures:

    reviews :: MonadReader a m => Iso' s a   -> (s -> r) -> m r
    reviews :: MonadReader a m => Prism' s a -> (s -> r) -> m r

reuse :: MonadState b m => AReview t b -> m t Source #

This can be used to turn an `Iso` or `Prism` around and `use` a value (or the current environment) through it the other way.

    reuse ≡ use . re
    reuse . unto ≡ gets

    >>> evalState (reuse _Left) 5
    Left 5

    >>> evalState (reuse (unto succ)) 5
    6

    reuse :: MonadState a m => Prism' s a -> m s
    reuse :: MonadState a m => Iso' s a   -> m s

reuses :: MonadState b m => AReview t b -> (t -> r) -> m r Source #

This can be used to turn an `Iso` or `Prism` around and `use` the current state through it the other way, applying a function.

    reuses ≡ uses . re
    reuses (unto f) g ≡ gets (g . f)

    >>> evalState (reuses _Left isLeft) (5 :: Int)
    True

    reuses :: MonadState a m => Prism' s a -> (s -> r) -> m r
    reuses :: MonadState a m => Iso' s a   -> (s -> r) -> m r

reviewing :: (Bifunctor p, Functor f) => Optic (Tagged :: Type -> Type -> Type) Identity s t a b -> Optic' p f t b Source #

Coerce a polymorphic `Prism` to a `Review`.

    reviewing :: Iso s t a b -> Review t b
    reviewing :: Prism s t a b -> Review t b

withPrism :: APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r Source #

Convert `APrism` to the pair of functions that characterize it.

clonePrism :: APrism s t a b -> Prism s t a b Source #

Clone a `Prism` so that you can reuse the same monomorphically typed `Prism` for different purposes.

See `cloneLens` and `cloneTraversal` for examples of why you might want to do this.

prism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b Source #

This is usually used to build a `Prism'`, when you have to use an operation like `cast` which already returns a `Maybe`.

aside :: APrism s t a b -> Prism (e, s) (e, t) (e, a) (e, b) Source #

Use a `Prism` to work over part of a structure.

below :: forall (f :: Type -> Type) s a. Traversable f => APrism' s a -> Prism' (f s) (f a) Source #

`lift` a `Prism` through a `Traversable` functor, giving a Prism that matches only if all the elements of the container match the `Prism`.

    >>> [Left 1, Right "foo", Left 4, Right "woot"]^..below _Right
    []

    >>> [Right "hail hydra!", Right "foo", Right "blah", Right "woot"]^..below _Right
    [["hail hydra!","foo","blah","woot"]]

isn't :: APrism s t a b -> s -> Bool Source #

Check to see if this `Prism` doesn't match.

    >>> isn't _Left (Right 12)
    True

    >>> isn't _Left (Left 12)
    False

    >>> isn't _Empty []
    False

    isn't = not . is
    isn't = hasn't

matching' :: LensLike (Either a) s t a b -> s -> Either t a Source #

Like `matching`, but also works for combinations of `Lens` and `Prism`s, and also `Traversal`s.

    >>> matching' (_2 . _Just) ('x', Just True)
    Right True

    >>> matching' (_2 . _Just) ('x', Nothing :: Maybe Int) :: Either (Char, Maybe Bool) Int
    Left ('x',Nothing)

    >>> matching' traverse "" :: Either [Int] Char
    Left []

    >>> matching' traverse "xyz" :: Either [Int] Char
    Right 'x'

_Right :: forall c a b p f. (Choice p, Applicative f) => p a (f b) -> p (Either c a) (f (Either c b)) Source #

This `Prism` provides a `Traversal` for tweaking the `Right` half of an `Either`:

    >>> over _Right (+1) (Left 2)
    Left 2

    >>> over _Right (+1) (Right 2)
    Right 3

    >>> Right "hello" ^._Right
    "hello"

    >>> Left "hello" ^._Right :: [Double]
    []

It also can be turned around to obtain the embedding into the `Right` half of an `Either`:

    >>> _Right # 5
    Right 5

    >>> 5^.re _Right
    Right 5

_Just :: forall a b p f. (Choice p, Applicative f) => p a (f b) -> p (Maybe a) (f (Maybe b)) Source #

This `Prism` provides a `Traversal` for tweaking the target of the value of `Just` in a `Maybe`.

    >>> over _Just (+1) (Just 2)
    Just 3

Unlike `traverse` this is a `Prism`, and so you can use it to inject as well:

    >>> _Just # 5
    Just 5

    >>> 5^.re _Just
    Just 5

Interestingly,

    m ^? _Just ≡ m

    >>> Just x ^? _Just
    Just x

    >>> Nothing ^? _Just
    Nothing

_Nothing :: forall a p f. (Choice p, Applicative f) => p () (f ()) -> p (Maybe a) (f (Maybe a)) Source #

This `Prism` provides the `Traversal` of a `Nothing` in a `Maybe`.

    >>> Nothing ^? _Nothing
    Just ()

    >>> Just () ^? _Nothing
    Nothing

But you can turn it around and use it to construct `Nothing` as well:

    >>> _Nothing # ()
    Nothing

_Void :: forall s a p f. (Choice p, Applicative f) => p a (f Void) -> p s (f s) Source #

`Void` is a logically uninhabited data type.

This is a `Prism` that will always fail to match.

only :: Eq a => a -> Prism' a () Source #

This `Prism` compares for exact equality with a given value.

    >>> only 4 # ()
    4

    >>> 5 ^? only 4
    Nothing

nearly :: a -> (a -> Bool) -> Prism' a () Source #

This `Prism` compares for approximate equality with a given value and a predicate for testing, an example where the value is the empty list and the predicate checks that a list is empty (same as `_Empty` with the `AsEmpty` list instance):

    >>> nearly [] null # ()
    []
    >>> [1,2,3,4] ^? nearly [] null
    Nothing

    nearly [] null :: Prism' [a] ()

To comply with the `Prism` laws the arguments you supply to `nearly a p` are somewhat constrained.

We assume `p x` holds iff `x ≡ a`. Under that assumption then this is a valid `Prism`.

This is useful when working with a type where you can test equality for only a subset of its values, and the prism selects such a value.

_Show :: (Read a, Show a) => Prism' String a Source #

This is an improper prism for text formatting based on `Read` and `Show`.

This `Prism` is "improper" in the sense that it normalizes the text formatting, but round tripping is idempotent given sane `Read`/`Show` instances.

    >>> _Show # 2
    "2"

    >>> "EQ" ^? _Show :: Maybe Ordering
    Just EQ

    _Show ≡ prism' show readMaybe

folding :: Foldable f => (s -> f a) -> Fold s a Source #

Obtain a `Fold` by lifting an operation that returns a `Foldable` result.

This can be useful to lift operations from `Data.List` and elsewhere into a `Fold`.

    >>> [1,2,3,4]^..folding reverse
    [4,3,2,1]

ifolding :: (Foldable f, Indexable i p, Contravariant g, Applicative g) => (s -> f (i, a)) -> Over p g s t a b Source #

foldring :: (Contravariant f, Applicative f) => ((a -> f a -> f a) -> f a -> s -> f a) -> LensLike f s t a b Source #

Obtain a `Fold` by lifting `foldr` like function.

    >>> [1,2,3,4]^..foldring foldr
    [1,2,3,4]

ifoldring :: (Indexable i p, Contravariant f, Applicative f) => ((i -> a -> f a -> f a) -> f a -> s -> f a) -> Over p f s t a b Source #

Obtain `FoldWithIndex` by lifting `ifoldr` like function.

folded64 :: forall (f :: Type -> Type) a. Foldable f => IndexedFold Int64 (f a) a Source #

Obtain a `Fold` from any `Foldable` indexed by ordinal position.

repeated :: Apply f => LensLike' f a a Source #

Form a `Fold1` by repeating the input forever.

    repeat ≡ toListOf repeated

    >>> timingOut $ 5^..taking 20 repeated
    [5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]

    repeated :: Fold1 a a

replicated :: Int -> Fold a a Source #

A `Fold` that replicates its input `n` times.

    replicate n ≡ toListOf (replicated n)

    >>> 5^..replicated 20
    [5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]

cycled :: Apply f => LensLike f s t a b -> LensLike f s t a b Source #

Transform a non-empty `Fold` into a `Fold1` that loops over its elements over and over.

    >>> timingOut $ [1,2,3]^..taking 7 (cycled traverse)
    [1,2,3,1,2,3,1]

    cycled :: Fold1 s a -> Fold1 s a

unfolded :: (b -> Maybe (a, b)) -> Fold b a Source #

Build a `Fold` that unfolds its values from a seed.

    unfoldr ≡ toListOf . unfolded

    >>> 10^..unfolded (\b -> if b == 0 then Nothing else Just (b, b-1))
    [10,9,8,7,6,5,4,3,2,1]

iterated :: Apply f => (a -> a) -> LensLike' f a a Source #

`x `^.` `iterated` f` returns an infinite `Fold1` of repeated applications of `f` to `x`.

    toListOf (iterated f) a ≡ iterate f a

    iterated :: (a -> a) -> Fold1 a a

filtered :: (Choice p, Applicative f) => (a -> Bool) -> Optic' p f a a Source #

Obtain a `Fold` that can be composed with to filter another `Lens`, `Iso`, `Getter`, `Fold` (or `Traversal`).

Note: This is not a legal `Traversal`, unless you are very careful not to invalidate the predicate on the target.

Note: This is also not a legal `Prism`, unless you are very careful not to inject a value that fails the predicate.

As a counter example, consider that given `evens = `filtered` `even`` the second `Traversal` law is violated:

    over evens succ . over evens succ /= over evens (succ . succ)

So, in order for this to qualify as a legal `Traversal` you can only use it for actions that preserve the result of the predicate!

    >>> [1..10]^..folded.filtered even
    [2,4,6,8,10]

This will preserve an index if it is present.

filteredBy :: (Indexable i p, Applicative f) => Getting (First i) a i -> p a (f a) -> a -> f a Source #

Obtain a potentially empty `IndexedTraversal` by taking the first element from another, potentially empty `Fold` and using it as an index.

The resulting optic can be composed with to filter another `Lens`, `Iso`, `Getter`, `Fold` (or `Traversal`).

    >>> [(Just 2, 3), (Nothing, 4)] & mapped . filteredBy (_1 . _Just) <. _2 %@~ (*) :: [(Maybe Int, Int)]
    [(Just 2,6),(Nothing,4)]

    filteredBy :: Fold a i -> IndexedTraversal' i a a

Note: As with `filtered`, this is not a legal `IndexedTraversal`, unless you are very careful not to invalidate the predicate on the target!

takingWhile :: (Conjoined p, Applicative f) => (a -> Bool) -> Over p (TakingWhile p f a a) s t a a -> Over p f s t a a Source #

Obtain a `Fold` by taking elements from another `Fold`, `Lens`, `Iso`, `Getter` or `Traversal` while a predicate holds.

    takeWhile p ≡ toListOf (takingWhile p folded)

    >>> timingOut $ toListOf (takingWhile (<=3) folded) [1..]
    [1,2,3]

    takingWhile :: (a -> Bool) -> Fold s a                         -> Fold s a
    takingWhile :: (a -> Bool) -> Getter s a                       -> Fold s a
    takingWhile :: (a -> Bool) -> Traversal' s a                   -> Fold s a -- * See note below
    takingWhile :: (a -> Bool) -> Lens' s a                        -> Fold s a -- * See note below
    takingWhile :: (a -> Bool) -> Prism' s a                       -> Fold s a -- * See note below
    takingWhile :: (a -> Bool) -> Iso' s a                         -> Fold s a -- * See note below
    takingWhile :: (a -> Bool) -> IndexedTraversal' i s a          -> IndexedFold i s a -- * See note below
    takingWhile :: (a -> Bool) -> IndexedLens' i s a               -> IndexedFold i s a -- * See note below
    takingWhile :: (a -> Bool) -> IndexedFold i s a                -> IndexedFold i s a
    takingWhile :: (a -> Bool) -> IndexedGetter i s a              -> IndexedFold i s a

Note: When applied to a `Traversal`, `takingWhile` yields something that can be used as if it were a `Traversal`, but which is not a `Traversal` per the laws, unless you are careful to ensure that you do not invalidate the predicate when writing back through it.

droppingWhile :: (Conjoined p, Profunctor q, Applicative f) => (a -> Bool) -> Optical p q (Compose (State Bool) f) s t a a -> Optical p q f s t a a Source #

Obtain a `Fold` by dropping elements from another `Fold`, `Lens`, `Iso`, `Getter` or `Traversal` while a predicate holds.

    dropWhile p ≡ toListOf (droppingWhile p folded)

    >>> toListOf (droppingWhile (<=3) folded) [1..6]
    [4,5,6]

    >>> toListOf (droppingWhile (<=3) folded) [1,6,1]
    [6,1]

    droppingWhile :: (a -> Bool) -> Fold s a                         -> Fold s a
    droppingWhile :: (a -> Bool) -> Getter s a                       -> Fold s a
    droppingWhile :: (a -> Bool) -> Traversal' s a                   -> Fold s a                -- see notes
    droppingWhile :: (a -> Bool) -> Lens' s a                        -> Fold s a                -- see notes
    droppingWhile :: (a -> Bool) -> Prism' s a                       -> Fold s a                -- see notes
    droppingWhile :: (a -> Bool) -> Iso' s a                         -> Fold s a                -- see notes

    droppingWhile :: (a -> Bool) -> IndexPreservingTraversal' s a    -> IndexPreservingFold s a -- see notes
    droppingWhile :: (a -> Bool) -> IndexPreservingLens' s a         -> IndexPreservingFold s a -- see notes
    droppingWhile :: (a -> Bool) -> IndexPreservingGetter s a        -> IndexPreservingFold s a
    droppingWhile :: (a -> Bool) -> IndexPreservingFold s a          -> IndexPreservingFold s a

    droppingWhile :: (a -> Bool) -> IndexedTraversal' i s a          -> IndexedFold i s a       -- see notes
    droppingWhile :: (a -> Bool) -> IndexedLens' i s a               -> IndexedFold i s a       -- see notes
    droppingWhile :: (a -> Bool) -> IndexedGetter i s a              -> IndexedFold i s a
    droppingWhile :: (a -> Bool) -> IndexedFold i s a                -> IndexedFold i s a

Note: Many uses of this combinator will yield something that meets the types, but not the laws of a valid `Traversal` or `IndexedTraversal`. The `Traversal` and `IndexedTraversal` laws are only satisfied if the new values you assign to the first target also does not pass the predicate! Otherwise subsequent traversals will visit fewer elements and `Traversal` fusion is not sound.

So for any traversal `t` and predicate `p`, ``droppingWhile` p t` may not be lawful, but `(`dropping` 1 . `droppingWhile` p) t` is. For example:

    >>> let l  :: Traversal' [Int] Int; l  = droppingWhile (<= 1) traverse
    >>> let l' :: Traversal' [Int] Int; l' = dropping 1 l

`l` is not a lawful setter because ``over` l f . `over` l g ≢ `over` l (f . g)`:

    >>> [1,2,3] & l .~ 0 & l .~ 4
    [1,0,0]
    >>> [1,2,3] & l .~ 4
    [1,4,4]

`l'` on the other hand behaves lawfully:

    >>> [1,2,3] & l' .~ 0 & l' .~ 4
    [1,2,4]
    >>> [1,2,3] & l' .~ 4
    [1,2,4]

worded :: forall (f :: Type -> Type). Applicative f => IndexedLensLike' Int f String String Source #

A `Fold` over the individual `words` of a `String`.

    worded :: Fold String String
    worded :: Traversal' String String

    worded :: IndexedFold Int String String
    worded :: IndexedTraversal' Int String String

Note: This function type-checks as a `Traversal` but it doesn't satisfy the laws. It's only valid to use it when you don't insert any whitespace characters while traversing, and if your original `String` contains only isolated space characters (and no other characters that count as space, such as non-breaking spaces).

lined :: forall (f :: Type -> Type). Applicative f => IndexedLensLike' Int f String String Source #

A `Fold` over the individual `lines` of a `String`.

    lined :: Fold String String
    lined :: Traversal' String String

    lined :: IndexedFold Int String String
    lined :: IndexedTraversal' Int String String

Note: This function type-checks as a `Traversal` but it doesn't satisfy the laws. It's only valid to use it when you don't insert any newline characters while traversing, and if your original `String` contains only isolated newline characters.

foldOf :: Getting a s a -> s -> a Source #

Combine the elements of a structure viewed through a `Lens`, `Getter`, `Fold` or `Traversal` using a monoid.

    >>> foldOf (folded.folded) [[Sum 1,Sum 4],[Sum 8, Sum 8],[Sum 21]]
    Sum {getSum = 42}

    fold = foldOf folded

    foldOf ≡ view

    foldOf ::             Getter s m     -> s -> m
    foldOf :: Monoid m => Fold s m       -> s -> m
    foldOf ::             Lens' s m      -> s -> m
    foldOf ::             Iso' s m       -> s -> m
    foldOf :: Monoid m => Traversal' s m -> s -> m
    foldOf :: Monoid m => Prism' s m     -> s -> m

foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r Source #

Right-associative fold of parts of a structure that are viewed through a `Lens`, `Getter`, `Fold` or `Traversal`.

    foldr ≡ foldrOf folded

    foldrOf :: Getter s a     -> (a -> r -> r) -> r -> s -> r
    foldrOf :: Fold s a       -> (a -> r -> r) -> r -> s -> r
    foldrOf :: Lens' s a      -> (a -> r -> r) -> r -> s -> r
    foldrOf :: Iso' s a       -> (a -> r -> r) -> r -> s -> r
    foldrOf :: Traversal' s a -> (a -> r -> r) -> r -> s -> r
    foldrOf :: Prism' s a     -> (a -> r -> r) -> r -> s -> r

    ifoldrOf l ≡ foldrOf l . Indexed

    foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r

foldlOf :: Getting (Dual (Endo r)) s a -> (r -> a -> r) -> r -> s -> r Source #

Left-associative fold of the parts of a structure that are viewed through a `Lens`, `Getter`, `Fold` or `Traversal`.

    foldl ≡ foldlOf folded

    foldlOf :: Getter s a     -> (r -> a -> r) -> r -> s -> r
    foldlOf :: Fold s a       -> (r -> a -> r) -> r -> s -> r
    foldlOf :: Lens' s a      -> (r -> a -> r) -> r -> s -> r
    foldlOf :: Iso' s a       -> (r -> a -> r) -> r -> s -> r
    foldlOf :: Traversal' s a -> (r -> a -> r) -> r -> s -> r
    foldlOf :: Prism' s a     -> (r -> a -> r) -> r -> s -> r

toListOf :: Getting (Endo [a]) s a -> s -> [a] Source #

Extract a list of the targets of a `Fold`. See also (`^..`).

    toList ≡ toListOf folded
    (^..) ≡ flip toListOf

toNonEmptyOf :: Getting (NonEmptyDList a) s a -> s -> NonEmpty a Source #

Extract a `NonEmpty` of the targets of `Fold1`.

    >>> toNonEmptyOf both1 ("hello", "world")
    "hello" :| ["world"]

    toNonEmptyOf :: Getter s a      -> s -> NonEmpty a
    toNonEmptyOf :: Fold1 s a       -> s -> NonEmpty a
    toNonEmptyOf :: Lens' s a       -> s -> NonEmpty a
    toNonEmptyOf :: Iso' s a        -> s -> NonEmpty a
    toNonEmptyOf :: Traversal1' s a -> s -> NonEmpty a

altOf :: Applicative f => Getting (Alt f a) s a -> s -> f a Source #

Calls `pure` on the target of a `Lens`, `Getter`, or `Iso`.

Calls `pure` on the targets of a `Traversal`, `Fold`, or `Prism`, and combines them with `<|>` (or `empty` if none). Intuitively, it collects targets into an `Alternative` until the container fills up or it runs out of targets, whichever comes first.

Generalizes `toListOf` and `(^?)`.

    >>> altOf both ("hello", "world") :: [String]
    ["hello","world"]
    >>> altOf both ("hello", "world") :: Maybe String
    Just "hello"

    altOf :: Applicative f => Lens' s a      -> s -> f a
    altOf :: Applicative f => Getter s a     -> s -> f a
    altOf :: Applicative f => Iso' s a       -> s -> f a

    altOf :: Alternative f => Traversal' s a -> s -> f a
    altOf :: Alternative f => Fold s a       -> s -> f a
    altOf :: Alternative f => Prism' s a     -> s -> f a

(^..) :: s -> Getting (Endo [a]) s a -> [a] infixl 8 Source #

A convenient infix (flipped) version of `toListOf`.

    >>> [[1,2],[3]]^..id
    [[[1,2],[3]]]
    >>> [[1,2],[3]]^..traverse
    [[1,2],[3]]
    >>> [[1,2],[3]]^..traverse.traverse
    [1,2,3]

    >>> (1,2)^..both
    [1,2]

    toList xs ≡ xs ^.. folded
    (^..) ≡ flip toListOf

    (^..) :: s -> Getter s a     -> a :: s -> Fold s a       -> a :: s -> Lens' s a      -> a :: s -> Iso' s a       -> a :: s -> Traversal' s a -> a :: s -> Prism' s a     -> [a]

andOf :: Getting All s Bool -> s -> Bool Source #

Returns `True` if every target of a `Fold` is `True`.

    >>> andOf both (True,False)
    False
    >>> andOf both (True,True)
    True

    and ≡ andOf folded

    andOf :: Getter s Bool     -> s -> Bool
    andOf :: Fold s Bool       -> s -> Bool
    andOf :: Lens' s Bool      -> s -> Bool
    andOf :: Iso' s Bool       -> s -> Bool
    andOf :: Traversal' s Bool -> s -> Bool
    andOf :: Prism' s Bool     -> s -> Bool

orOf :: Getting Any s Bool -> s -> Bool Source #

Returns `True` if any target of a `Fold` is `True`.

    >>> orOf both (True,False)
    True
    >>> orOf both (False,False)
    False

    or ≡ orOf folded

    orOf :: Getter s Bool     -> s -> Bool
    orOf :: Fold s Bool       -> s -> Bool
    orOf :: Lens' s Bool      -> s -> Bool
    orOf :: Iso' s Bool       -> s -> Bool
    orOf :: Traversal' s Bool -> s -> Bool
    orOf :: Prism' s Bool     -> s -> Bool

allOf :: Getting All s a -> (a -> Bool) -> s -> Bool Source #

Returns `True` if every target of a `Fold` satisfies a predicate.

    >>> allOf both (>=3) (4,5)
    True
    >>> allOf folded (>=2) [1..10]
    False

    all ≡ allOf folded

    iallOf l = allOf l . Indexed

    allOf :: Getter s a     -> (a -> Bool) -> s -> Bool
    allOf :: Fold s a       -> (a -> Bool) -> s -> Bool
    allOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
    allOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
    allOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
    allOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

noneOf :: Getting Any s a -> (a -> Bool) -> s -> Bool Source #

Returns `True` only if no targets of a `Fold` satisfy a predicate.

    >>> noneOf each (is _Nothing) (Just 3, Just 4, Just 5)
    True
    >>> noneOf (folded.folded) (<10) [[13,99,20],[3,71,42]]
    False

    inoneOf l = noneOf l . Indexed

    noneOf :: Getter s a     -> (a -> Bool) -> s -> Bool
    noneOf :: Fold s a       -> (a -> Bool) -> s -> Bool
    noneOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
    noneOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
    noneOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
    noneOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

productOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a Source #

Calculate the `Product` of every number targeted by a `Fold`.

    >>> productOf both (4,5)
    20
    >>> productOf folded [1,2,3,4,5]
    120

    product ≡ productOf folded

This operation may be more strict than you would expect. If you want a lazier version use ``ala` `Product` `.` `foldMapOf``

    productOf :: Num a => Getter s a     -> s -> a
    productOf :: Num a => Fold s a       -> s -> a
    productOf :: Num a => Lens' s a      -> s -> a
    productOf :: Num a => Iso' s a       -> s -> a
    productOf :: Num a => Traversal' s a -> s -> a
    productOf :: Num a => Prism' s a     -> s -> a

sumOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a Source #

Calculate the `Sum` of every number targeted by a `Fold`.

    >>> sumOf both (5,6)
    11
    >>> sumOf folded [1,2,3,4]
    10
    >>> sumOf (folded.both) [(1,2),(3,4)]
    10
    >>> import Data.Data.Lens
    >>> sumOf biplate [(1::Int,[]),(2,[(3::Int,4::Int)])] :: Int
    10

    sum ≡ sumOf folded

This operation may be more strict than you would expect. If you want a lazier version use ``ala` `Sum` `.` `foldMapOf``

    sumOf _1 :: Num a => (a, b) -> a
    sumOf (folded . _1) :: (Foldable f, Num a) => f (a, b) -> a

    sumOf :: Num a => Getter s a     -> s -> a
    sumOf :: Num a => Fold s a       -> s -> a
    sumOf :: Num a => Lens' s a      -> s -> a
    sumOf :: Num a => Iso' s a       -> s -> a
    sumOf :: Num a => Traversal' s a -> s -> a
    sumOf :: Num a => Prism' s a     -> s -> a

forOf_ :: Functor f => Getting (Traversed r f) s a -> s -> (a -> f r) -> f () Source #

Traverse over all of the targets of a `Fold` (or `Getter`), computing an `Applicative` (or `Functor`)-based answer, but unlike `forOf` do not construct a new structure. `forOf_` generalizes `for_` to work over any `Fold`.

When passed a `Getter`, `forOf_` can work over any `Functor`, but when passed a `Fold`, `forOf_` requires an `Applicative`.

    for_ ≡ forOf_ folded

    >>> forOf_ both ("hello","world") putStrLn
    hello
    world

The rather specific signature of `forOf_` allows it to be used as if the signature was any of:

    iforOf_ l s ≡ forOf_ l s . Indexed

    forOf_ :: Functor f     => Getter s a     -> s -> (a -> f r) -> f ()
    forOf_ :: Applicative f => Fold s a       -> s -> (a -> f r) -> f ()
    forOf_ :: Functor f     => Lens' s a      -> s -> (a -> f r) -> f ()
    forOf_ :: Functor f     => Iso' s a       -> s -> (a -> f r) -> f ()
    forOf_ :: Applicative f => Traversal' s a -> s -> (a -> f r) -> f ()
    forOf_ :: Applicative f => Prism' s a     -> s -> (a -> f r) -> f ()

sequenceAOf_ :: Functor f => Getting (Traversed a f) s (f a) -> s -> f () Source #

Evaluate each action in observed by a `Fold` on a structure from left to right, ignoring the results.

    sequenceA_ ≡ sequenceAOf_ folded

    >>> sequenceAOf_ both (putStrLn "hello",putStrLn "world")
    hello
    world

    sequenceAOf_ :: Functor f     => Getter s (f a)     -> s -> f ()
    sequenceAOf_ :: Applicative f => Fold s (f a)       -> s -> f ()
    sequenceAOf_ :: Functor f     => Lens' s (f a)      -> s -> f ()
    sequenceAOf_ :: Functor f     => Iso' s (f a)       -> s -> f ()
    sequenceAOf_ :: Applicative f => Traversal' s (f a) -> s -> f ()
    sequenceAOf_ :: Applicative f => Prism' s (f a)     -> s -> f ()

for1Of_ :: Functor f => Getting (TraversedF r f) s a -> s -> (a -> f r) -> f () Source #

See `forOf_` and `traverse1Of_`.

    >>> for1Of_ both1 ("abc", "bcd") (\ks -> Map.fromList [ (k, ()) | k <- ks ])
    fromList [('b',()),('c',())]

    for1Of_ :: Apply f => Fold1 s a -> s -> (a -> f r) -> f ()

Since: lens-4.16

sequence1Of_ :: Functor f => Getting (TraversedF a f) s (f a) -> s -> f () Source #

See `sequenceAOf_` and `traverse1Of_`.

    sequence1Of_ :: Apply f => Fold1 s (f a) -> s -> f ()

Since: lens-4.16

mapMOf_ :: Monad m => Getting (Sequenced r m) s a -> (a -> m r) -> s -> m () Source #

Map each target of a `Fold` on a structure to a monadic action, evaluate these actions from left to right, and ignore the results.

    >>> mapMOf_ both putStrLn ("hello","world")
    hello
    world

    mapM_ ≡ mapMOf_ folded

    mapMOf_ :: Monad m => Getter s a     -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Fold s a       -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Lens' s a      -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Iso' s a       -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Traversal' s a -> (a -> m r) -> s -> m ()
    mapMOf_ :: Monad m => Prism' s a     -> (a -> m r) -> s -> m ()

forMOf_ :: Monad m => Getting (Sequenced r m) s a -> s -> (a -> m r) -> m () Source #

`forMOf_` is `mapMOf_` with two of its arguments flipped.

    >>> forMOf_ both ("hello","world") putStrLn
    hello
    world

    forM_ ≡ forMOf_ folded

    forMOf_ :: Monad m => Getter s a     -> s -> (a -> m r) -> m ()
    forMOf_ :: Monad m => Fold s a       -> s -> (a -> m r) -> m ()
    forMOf_ :: Monad m => Lens' s a      -> s -> (a -> m r) -> m ()
    forMOf_ :: Monad m => Iso' s a       -> s -> (a -> m r) -> m ()
    forMOf_ :: Monad m => Traversal' s a -> s -> (a -> m r) -> m ()
    forMOf_ :: Monad m => Prism' s a     -> s -> (a -> m r) -> m ()

sequenceOf_ :: Monad m => Getting (Sequenced a m) s (m a) -> s -> m () Source #

Evaluate each monadic action referenced by a `Fold` on the structure from left to right, and ignore the results.

    >>> sequenceOf_ both (putStrLn "hello",putStrLn "world")
    hello
    world

    sequence_ ≡ sequenceOf_ folded

    sequenceOf_ :: Monad m => Getter s (m a)     -> s -> m ()
    sequenceOf_ :: Monad m => Fold s (m a)       -> s -> m ()
    sequenceOf_ :: Monad m => Lens' s (m a)      -> s -> m ()
    sequenceOf_ :: Monad m => Iso' s (m a)       -> s -> m ()
    sequenceOf_ :: Monad m => Traversal' s (m a) -> s -> m ()
    sequenceOf_ :: Monad m => Prism' s (m a)     -> s -> m ()

asumOf :: Alternative f => Getting (Endo (f a)) s (f a) -> s -> f a Source #

The sum of a collection of actions, generalizing `concatOf`.

    >>> asumOf both ("hello","world")
    "helloworld"

    >>> asumOf each (Nothing, Just "hello", Nothing)
    Just "hello"

    asum ≡ asumOf folded

    asumOf :: Alternative f => Getter s (f a)     -> s -> f a
    asumOf :: Alternative f => Fold s (f a)       -> s -> f a
    asumOf :: Alternative f => Lens' s (f a)      -> s -> f a
    asumOf :: Alternative f => Iso' s (f a)       -> s -> f a
    asumOf :: Alternative f => Traversal' s (f a) -> s -> f a
    asumOf :: Alternative f => Prism' s (f a)     -> s -> f a

msumOf :: MonadPlus m => Getting (Endo (m a)) s (m a) -> s -> m a Source #

The sum of a collection of actions, generalizing `concatOf`.

    >>> msumOf both ("hello","world")
    "helloworld"

    >>> msumOf each (Nothing, Just "hello", Nothing)
    Just "hello"

    msum ≡ msumOf folded

    msumOf :: MonadPlus m => Getter s (m a)     -> s -> m a
    msumOf :: MonadPlus m => Fold s (m a)       -> s -> m a
    msumOf :: MonadPlus m => Lens' s (m a)      -> s -> m a
    msumOf :: MonadPlus m => Iso' s (m a)       -> s -> m a
    msumOf :: MonadPlus m => Traversal' s (m a) -> s -> m a
    msumOf :: MonadPlus m => Prism' s (m a)     -> s -> m a

elemOf :: Eq a => Getting Any s a -> a -> s -> Bool Source #

Does the element occur anywhere within a given `Fold` of the structure?

    >>> elemOf both "hello" ("hello","world")
    True

    elem ≡ elemOf folded

    elemOf :: Eq a => Getter s a     -> a -> s -> Bool
    elemOf :: Eq a => Fold s a       -> a -> s -> Bool
    elemOf :: Eq a => Lens' s a      -> a -> s -> Bool
    elemOf :: Eq a => Iso' s a       -> a -> s -> Bool
    elemOf :: Eq a => Traversal' s a -> a -> s -> Bool
    elemOf :: Eq a => Prism' s a     -> a -> s -> Bool

notElemOf :: Eq a => Getting All s a -> a -> s -> Bool Source #

Does the element not occur anywhere within a given `Fold` of the structure?

    >>> notElemOf each 'd' ('a','b','c')
    True

    >>> notElemOf each 'a' ('a','b','c')
    False

    notElem ≡ notElemOf folded

    notElemOf :: Eq a => Getter s a     -> a -> s -> Bool
    notElemOf :: Eq a => Fold s a       -> a -> s -> Bool
    notElemOf :: Eq a => Iso' s a       -> a -> s -> Bool
    notElemOf :: Eq a => Lens' s a      -> a -> s -> Bool
    notElemOf :: Eq a => Traversal' s a -> a -> s -> Bool
    notElemOf :: Eq a => Prism' s a     -> a -> s -> Bool

concatMapOf :: Getting [r] s a -> (a -> [r]) -> s -> [r] Source #

Map a function over all the targets of a `Fold` of a container and concatenate the resulting lists.

    >>> concatMapOf both (\x -> [x, x + 1]) (1,3)
    [1,2,3,4]

    concatMap ≡ concatMapOf folded

    concatMapOf :: Getter s a     -> (a -> [r]) -> s -> [r]
    concatMapOf :: Fold s a       -> (a -> [r]) -> s -> [r]
    concatMapOf :: Lens' s a      -> (a -> [r]) -> s -> [r]
    concatMapOf :: Iso' s a       -> (a -> [r]) -> s -> [r]
    concatMapOf :: Traversal' s a -> (a -> [r]) -> s -> [r]

concatOf :: Getting [r] s [r] -> s -> [r] Source #

Concatenate all of the lists targeted by a `Fold` into a longer list.

    >>> concatOf both ("pan","ama")
    "panama"

    concat ≡ concatOf folded
    concatOf ≡ view

    concatOf :: Getter s [r]     -> s -> [r]
    concatOf :: Fold s [r]       -> s -> [r]
    concatOf :: Iso' s [r]       -> s -> [r]
    concatOf :: Lens' s [r]      -> s -> [r]
    concatOf :: Traversal' s [r] -> s -> [r]

(^?!) :: HasCallStack => s -> Getting (Endo a) s a -> a infixl 8 Source #

Perform an *UNSAFE* `head` of a `Fold` or `Traversal` assuming that it is there.

    >>> Left 4 ^?! _Left
    4

    >>> "world" ^?! ix 3
    'l'

    (^?!) :: s -> Getter s a     -> a
    (^?!) :: s -> Fold s a       -> a
    (^?!) :: s -> Lens' s a      -> a
    (^?!) :: s -> Iso' s a       -> a
    (^?!) :: s -> Traversal' s a -> a

first1Of :: Getting (First a) s a -> s -> a Source #

Retrieve the `First` entry of a `Fold1` or `Traversal1` or the result from a `Getter` or `Lens`.

    >>> first1Of traverse1 (1 :| [2..10])
    1

    >>> first1Of both1 (1,2)
    1

Note: this is different from `^.`.

    >>> first1Of traverse1 ([1,2] :| [[3,4],[5,6]])
    [1,2]

    >>> ([1,2] :| [[3,4],[5,6]]) ^. traverse1
    [1,2,3,4,5,6]

    first1Of :: Getter s a      -> s -> a
    first1Of :: Fold1 s a       -> s -> a
    first1Of :: Lens' s a       -> s -> a
    first1Of :: Iso' s a        -> s -> a
    first1Of :: Traversal1' s a -> s -> a

last1Of :: Getting (Last a) s a -> s -> a Source #

Retrieve the `Last` entry of a `Fold1` or `Traversal1` or retrieve the result from a `Getter` or `Lens`.o

    >>> last1Of traverse1 (1 :| [2..10])
    10

    >>> last1Of both1 (1,2)
    2

    last1Of :: Getter s a      -> s -> Maybe a
    last1Of :: Fold1 s a       -> s -> Maybe a
    last1Of :: Lens' s a       -> s -> Maybe a
    last1Of :: Iso' s a        -> s -> Maybe a
    last1Of :: Traversal1' s a -> s -> Maybe a

nullOf :: Getting All s a -> s -> Bool Source #

Returns `True` if this `Fold` or `Traversal` has no targets in the given container.

Note: `nullOf` on a valid `Iso`, `Lens` or `Getter` should always return `False`.

    null ≡ nullOf folded

This may be rather inefficient compared to the `null` check of many containers.

    >>> nullOf _1 (1,2)
    False

    >>> nullOf ignored ()
    True

    >>> nullOf traverse []
    True

    >>> nullOf (element 20) [1..10]
    True

    nullOf (folded . _1 . folded) :: (Foldable f, Foldable g) => f (g a, b) -> Bool

    nullOf :: Getter s a     -> s -> Bool
    nullOf :: Fold s a       -> s -> Bool
    nullOf :: Iso' s a       -> s -> Bool
    nullOf :: Lens' s a      -> s -> Bool
    nullOf :: Traversal' s a -> s -> Bool

notNullOf :: Getting Any s a -> s -> Bool Source #

Returns `True` if this `Fold` or `Traversal` has any targets in the given container.

A more "conversational" alias for this combinator is `has`.

Note: `notNullOf` on a valid `Iso`, `Lens` or `Getter` should always return `True`.

    not . null ≡ notNullOf folded

This may be rather inefficient compared to the ``not` `.` `null`` check of many containers.

    >>> notNullOf _1 (1,2)
    True

    >>> notNullOf traverse [1..10]
    True

    >>> notNullOf folded []
    False

    >>> notNullOf (element 20) [1..10]
    False

    notNullOf (folded . _1 . folded) :: (Foldable f, Foldable g) => f (g a, b) -> Bool

    notNullOf :: Getter s a     -> s -> Bool
    notNullOf :: Fold s a       -> s -> Bool
    notNullOf :: Iso' s a       -> s -> Bool
    notNullOf :: Lens' s a      -> s -> Bool
    notNullOf :: Traversal' s a -> s -> Bool

maximumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a Source #

Obtain the maximum element (if any) targeted by a `Fold` or `Traversal` safely.

Note: `maximumOf` on a valid `Iso`, `Lens` or `Getter` will always return `Just` a value.

    >>> maximumOf traverse [1..10]
    Just 10

    >>> maximumOf traverse []
    Nothing

    >>> maximumOf (folded.filtered even) [1,4,3,6,7,9,2]
    Just 6

    maximum ≡ fromMaybe (error "empty") . maximumOf folded

In the interest of efficiency, This operation has semantics more strict than strictly necessary. ``rmap` `getMax` (`foldMapOf` l `Max`)` has lazier semantics but could leak memory.

    maximumOf :: Ord a => Getter s a     -> s -> Maybe a
    maximumOf :: Ord a => Fold s a       -> s -> Maybe a
    maximumOf :: Ord a => Iso' s a       -> s -> Maybe a
    maximumOf :: Ord a => Lens' s a      -> s -> Maybe a
    maximumOf :: Ord a => Traversal' s a -> s -> Maybe a

maximum1Of :: Ord a => Getting (Max a) s a -> s -> a Source #

Obtain the maximum element targeted by a `Fold1` or `Traversal1`.

    >>> maximum1Of traverse1 (1 :| [2..10])
    10

    maximum1Of :: Ord a => Getter s a      -> s -> a
    maximum1Of :: Ord a => Fold1 s a       -> s -> a
    maximum1Of :: Ord a => Iso' s a        -> s -> a
    maximum1Of :: Ord a => Lens' s a       -> s -> a
    maximum1Of :: Ord a => Traversal1' s a -> s -> a

minimumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a Source #

Obtain the minimum element (if any) targeted by a `Fold` or `Traversal` safely.

Note: `minimumOf` on a valid `Iso`, `Lens` or `Getter` will always return `Just` a value.

    >>> minimumOf traverse [1..10]
    Just 1

    >>> minimumOf traverse []
    Nothing

    >>> minimumOf (folded.filtered even) [1,4,3,6,7,9,2]
    Just 2

    minimum ≡ fromMaybe (error "empty") . minimumOf folded

In the interest of efficiency, This operation has semantics more strict than strictly necessary. ``rmap` `getMin` (`foldMapOf` l `Min`)` has lazier semantics but could leak memory.

    minimumOf :: Ord a => Getter s a     -> s -> Maybe a
    minimumOf :: Ord a => Fold s a       -> s -> Maybe a
    minimumOf :: Ord a => Iso' s a       -> s -> Maybe a
    minimumOf :: Ord a => Lens' s a      -> s -> Maybe a
    minimumOf :: Ord a => Traversal' s a -> s -> Maybe a

minimum1Of :: Ord a => Getting (Min a) s a -> s -> a Source #

Obtain the minimum element targeted by a `Fold1` or `Traversal1`.

    >>> minimum1Of traverse1 (1 :| [2..10])
    1

    minimum1Of :: Ord a => Getter s a      -> s -> a
    minimum1Of :: Ord a => Fold1 s a       -> s -> a
    minimum1Of :: Ord a => Iso' s a        -> s -> a
    minimum1Of :: Ord a => Lens' s a       -> s -> a
    minimum1Of :: Ord a => Traversal1' s a -> s -> a

maximumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a Source #

Obtain the maximum element (if any) targeted by a `Fold`, `Traversal`, `Lens`, `Iso`, or `Getter` according to a user supplied `Ordering`.

    >>> maximumByOf traverse (compare `on` length) ["mustard","relish","ham"]
    Just "mustard"

In the interest of efficiency, This operation has semantics more strict than strictly necessary.

    maximumBy cmp ≡ fromMaybe (error "empty") . maximumByOf folded cmp

    maximumByOf :: Getter s a     -> (a -> a -> Ordering) -> s -> Maybe a
    maximumByOf :: Fold s a       -> (a -> a -> Ordering) -> s -> Maybe a
    maximumByOf :: Iso' s a       -> (a -> a -> Ordering) -> s -> Maybe a
    maximumByOf :: Lens' s a      -> (a -> a -> Ordering) -> s -> Maybe a
    maximumByOf :: Traversal' s a -> (a -> a -> Ordering) -> s -> Maybe a

minimumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a Source #

Obtain the minimum element (if any) targeted by a `Fold`, `Traversal`, `Lens`, `Iso` or `Getter` according to a user supplied `Ordering`.

In the interest of efficiency, This operation has semantics more strict than strictly necessary.

    >>> minimumByOf traverse (compare `on` length) ["mustard","relish","ham"]
    Just "ham"

    minimumBy cmp ≡ fromMaybe (error "empty") . minimumByOf folded cmp

    minimumByOf :: Getter s a     -> (a -> a -> Ordering) -> s -> Maybe a
    minimumByOf :: Fold s a       -> (a -> a -> Ordering) -> s -> Maybe a
    minimumByOf :: Iso' s a       -> (a -> a -> Ordering) -> s -> Maybe a
    minimumByOf :: Lens' s a      -> (a -> a -> Ordering) -> s -> Maybe a
    minimumByOf :: Traversal' s a -> (a -> a -> Ordering) -> s -> Maybe a

findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a Source #

The `findOf` function takes a `Lens` (or `Getter`, `Iso`, `Fold`, or `Traversal`), a predicate and a structure and returns the leftmost element of the structure matching the predicate, or `Nothing` if there is no such element.

    >>> findOf each even (1,3,4,6)
    Just 4

    >>> findOf folded even [1,3,5,7]
    Nothing

    findOf :: Getter s a     -> (a -> Bool) -> s -> Maybe a
    findOf :: Fold s a       -> (a -> Bool) -> s -> Maybe a
    findOf :: Iso' s a       -> (a -> Bool) -> s -> Maybe a
    findOf :: Lens' s a      -> (a -> Bool) -> s -> Maybe a
    findOf :: Traversal' s a -> (a -> Bool) -> s -> Maybe a

    find ≡ findOf folded
    ifindOf l ≡ findOf l . Indexed

A simpler version that didn't permit indexing, would be:

    findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a
    findOf l p = foldrOf l (a y -> if p a then Just a else y) Nothing

findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a) Source #

The `findMOf` function takes a `Lens` (or `Getter`, `Iso`, `Fold`, or `Traversal`), a monadic predicate and a structure and returns in the monad the leftmost element of the structure matching the predicate, or `Nothing` if there is no such element.

    >>> findMOf each ( \x -> print ("Checking " ++ show x) >> return (even x)) (1,3,4,6)
    "Checking 1"
    "Checking 3"
    "Checking 4"
    Just 4

    >>> findMOf each ( \x -> print ("Checking " ++ show x) >> return (even x)) (1,3,5,7)
    "Checking 1"
    "Checking 3"
    "Checking 5"
    "Checking 7"
    Nothing

    findMOf :: (Monad m, Getter s a)     -> (a -> m Bool) -> s -> m (Maybe a)
    findMOf :: (Monad m, Fold s a)       -> (a -> m Bool) -> s -> m (Maybe a)
    findMOf :: (Monad m, Iso' s a)       -> (a -> m Bool) -> s -> m (Maybe a)
    findMOf :: (Monad m, Lens' s a)      -> (a -> m Bool) -> s -> m (Maybe a)
    findMOf :: (Monad m, Traversal' s a) -> (a -> m Bool) -> s -> m (Maybe a)

    findMOf folded :: (Monad m, Foldable f) => (a -> m Bool) -> f a -> m (Maybe a)
    ifindMOf l ≡ findMOf l . Indexed

A simpler version that didn't permit indexing, would be:

    findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a)
    findMOf l p = foldrOf l (a y -> p a >>= x -> if x then return (Just a) else y) $ return Nothing

lookupOf :: Eq k => Getting (Endo (Maybe v)) s (k, v) -> k -> s -> Maybe v Source #

The `lookupOf` function takes a `Fold` (or `Getter`, `Traversal`, `Lens`, `Iso`, etc.), a key, and a structure containing key/value pairs. It returns the first value corresponding to the given key. This function generalizes `lookup` to work on an arbitrary `Fold` instead of lists.

    >>> lookupOf folded 4 [(2, 'a'), (4, 'b'), (4, 'c')]
    Just 'b'

    >>> lookupOf each 2 [(2, 'a'), (4, 'b'), (4, 'c')]
    Just 'a'

    lookupOf :: Eq k => Fold s (k,v) -> k -> s -> Maybe v

foldr1Of :: HasCallStack => Getting (Endo (Maybe a)) s a -> (a -> a -> a) -> s -> a Source #

A variant of `foldrOf` that has no base case and thus may only be applied to lenses and structures such that the `Lens` views at least one element of the structure.

    >>> foldr1Of each (+) (1,2,3,4)
    10

    foldr1Of l f ≡ foldr1 f . toListOf l
    foldr1 ≡ foldr1Of folded

    foldr1Of :: Getter s a     -> (a -> a -> a) -> s -> a
    foldr1Of :: Fold s a       -> (a -> a -> a) -> s -> a
    foldr1Of :: Iso' s a       -> (a -> a -> a) -> s -> a
    foldr1Of :: Lens' s a      -> (a -> a -> a) -> s -> a
    foldr1Of :: Traversal' s a -> (a -> a -> a) -> s -> a

foldl1Of :: HasCallStack => Getting (Dual (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a Source #

A variant of `foldlOf` that has no base case and thus may only be applied to lenses and structures such that the `Lens` views at least one element of the structure.

    >>> foldl1Of each (+) (1,2,3,4)
    10

    foldl1Of l f ≡ foldl1 f . toListOf l
    foldl1 ≡ foldl1Of folded

    foldl1Of :: Getter s a     -> (a -> a -> a) -> s -> a
    foldl1Of :: Fold s a       -> (a -> a -> a) -> s -> a
    foldl1Of :: Iso' s a       -> (a -> a -> a) -> s -> a
    foldl1Of :: Lens' s a      -> (a -> a -> a) -> s -> a
    foldl1Of :: Traversal' s a -> (a -> a -> a) -> s -> a

foldrOf' :: Getting (Dual (Endo (Endo r))) s a -> (a -> r -> r) -> r -> s -> r Source #

Strictly fold right over the elements of a structure.

    foldr' ≡ foldrOf' folded

    foldrOf' :: Getter s a     -> (a -> r -> r) -> r -> s -> r
    foldrOf' :: Fold s a       -> (a -> r -> r) -> r -> s -> r
    foldrOf' :: Iso' s a       -> (a -> r -> r) -> r -> s -> r
    foldrOf' :: Lens' s a      -> (a -> r -> r) -> r -> s -> r
    foldrOf' :: Traversal' s a -> (a -> r -> r) -> r -> s -> r

foldlOf' :: Getting (Endo (Endo r)) s a -> (r -> a -> r) -> r -> s -> r Source #

Fold over the elements of a structure, associating to the left, but strictly.

    foldl' ≡ foldlOf' folded

    foldlOf' :: Getter s a     -> (r -> a -> r) -> r -> s -> r
    foldlOf' :: Fold s a       -> (r -> a -> r) -> r -> s -> r
    foldlOf' :: Iso' s a       -> (r -> a -> r) -> r -> s -> r
    foldlOf' :: Lens' s a      -> (r -> a -> r) -> r -> s -> r
    foldlOf' :: Traversal' s a -> (r -> a -> r) -> r -> s -> r

foldr1Of' :: HasCallStack => Getting (Dual (Endo (Endo (Maybe a)))) s a -> (a -> a -> a) -> s -> a Source #

A variant of `foldrOf'` that has no base case and thus may only be applied to folds and structures such that the fold views at least one element of the structure.

    foldr1Of l f ≡ foldr1 f . toListOf l

    foldr1Of' :: Getter s a     -> (a -> a -> a) -> s -> a
    foldr1Of' :: Fold s a       -> (a -> a -> a) -> s -> a
    foldr1Of' :: Iso' s a       -> (a -> a -> a) -> s -> a
    foldr1Of' :: Lens' s a      -> (a -> a -> a) -> s -> a
    foldr1Of' :: Traversal' s a -> (a -> a -> a) -> s -> a

foldl1Of' :: HasCallStack => Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a Source #

A variant of `foldlOf'` that has no base case and thus may only be applied to folds and structures such that the fold views at least one element of the structure.

    foldl1Of' l f ≡ foldl1' f . toListOf l

    foldl1Of' :: Getter s a     -> (a -> a -> a) -> s -> a
    foldl1Of' :: Fold s a       -> (a -> a -> a) -> s -> a
    foldl1Of' :: Iso' s a       -> (a -> a -> a) -> s -> a
    foldl1Of' :: Lens' s a      -> (a -> a -> a) -> s -> a
    foldl1Of' :: Traversal' s a -> (a -> a -> a) -> s -> a

foldrMOf :: Monad m => Getting (Dual (Endo (r -> m r))) s a -> (a -> r -> m r) -> r -> s -> m r Source #

Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.

    foldrM ≡ foldrMOf folded

    foldrMOf :: Monad m => Getter s a     -> (a -> r -> m r) -> r -> s -> m r
    foldrMOf :: Monad m => Fold s a       -> (a -> r -> m r) -> r -> s -> m r
    foldrMOf :: Monad m => Iso' s a       -> (a -> r -> m r) -> r -> s -> m r
    foldrMOf :: Monad m => Lens' s a      -> (a -> r -> m r) -> r -> s -> m r
    foldrMOf :: Monad m => Traversal' s a -> (a -> r -> m r) -> r -> s -> m r

foldlMOf :: Monad m => Getting (Endo (r -> m r)) s a -> (r -> a -> m r) -> r -> s -> m r Source #

Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.

    foldlM ≡ foldlMOf folded

    foldlMOf :: Monad m => Getter s a     -> (r -> a -> m r) -> r -> s -> m r
    foldlMOf :: Monad m => Fold s a       -> (r -> a -> m r) -> r -> s -> m r
    foldlMOf :: Monad m => Iso' s a       -> (r -> a -> m r) -> r -> s -> m r
    foldlMOf :: Monad m => Lens' s a      -> (r -> a -> m r) -> r -> s -> m r
    foldlMOf :: Monad m => Traversal' s a -> (r -> a -> m r) -> r -> s -> m r

has :: Getting Any s a -> s -> Bool Source #

Check to see if this `Fold` or `Traversal` matches 1 or more entries.

    >>> has (element 0) []
    False

    >>> has _Left (Left 12)
    True

    >>> has _Right (Left 12)
    False

This will always return `True` for a `Lens` or `Getter`.

    >>> has _1 ("hello","world")
    True

    has :: Getter s a     -> s -> Bool
    has :: Fold s a       -> s -> Bool
    has :: Iso' s a       -> s -> Bool
    has :: Lens' s a      -> s -> Bool
    has :: Traversal' s a -> s -> Bool

hasn't :: Getting All s a -> s -> Bool Source #

Check to see if this `Fold` or `Traversal` has no matches.

    >>> hasn't _Left (Right 12)
    True

    >>> hasn't _Left (Left 12)
    False

pre :: Getting (First a) s a -> IndexPreservingGetter s (Maybe a) Source #

This converts a `Fold` to a `IndexPreservingGetter` that returns the first element, if it exists, as a `Maybe`.

    pre :: Getter s a     -> IndexPreservingGetter s (Maybe a)
    pre :: Fold s a       -> IndexPreservingGetter s (Maybe a)
    pre :: Traversal' s a -> IndexPreservingGetter s (Maybe a)
    pre :: Lens' s a      -> IndexPreservingGetter s (Maybe a)
    pre :: Iso' s a       -> IndexPreservingGetter s (Maybe a)
    pre :: Prism' s a     -> IndexPreservingGetter s (Maybe a)

ipre :: IndexedGetting i (First (i, a)) s a -> IndexPreservingGetter s (Maybe (i, a)) Source #

This converts an `IndexedFold` to an `IndexPreservingGetter` that returns the first index and element, if they exist, as a `Maybe`.

    ipre :: IndexedGetter i s a     -> IndexPreservingGetter s (Maybe (i, a))
    ipre :: IndexedFold i s a       -> IndexPreservingGetter s (Maybe (i, a))
    ipre :: IndexedTraversal' i s a -> IndexPreservingGetter s (Maybe (i, a))
    ipre :: IndexedLens' i s a      -> IndexPreservingGetter s (Maybe (i, a))

ipreview :: MonadReader s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a)) Source #

Retrieve the first index and value targeted by a `Fold` or `Traversal` (or `Just` the result from a `Getter` or `Lens`). See also (`^@?`).

    ipreview = view . ipre

This is usually applied in the `Reader` `Monad` `(->) s`.

    ipreview :: IndexedGetter i s a     -> s -> Maybe (i, a)
    ipreview :: IndexedFold i s a       -> s -> Maybe (i, a)
    ipreview :: IndexedLens' i s a      -> s -> Maybe (i, a)
    ipreview :: IndexedTraversal' i s a -> s -> Maybe (i, a)

However, it may be useful to think of its full generality when working with a `Monad` transformer stack:

    ipreview :: MonadReader s m => IndexedGetter s a     -> m (Maybe (i, a))
    ipreview :: MonadReader s m => IndexedFold s a       -> m (Maybe (i, a))
    ipreview :: MonadReader s m => IndexedLens' s a      -> m (Maybe (i, a))
    ipreview :: MonadReader s m => IndexedTraversal' s a -> m (Maybe (i, a))

previews :: MonadReader s m => Getting (First r) s a -> (a -> r) -> m (Maybe r) Source #

Retrieve a function of the first value targeted by a `Fold` or `Traversal` (or `Just` the result from a `Getter` or `Lens`).

This is usually applied in the `Reader` `Monad` `(->) s`.

ipreviews :: MonadReader s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r) Source #

Retrieve a function of the first index and value targeted by an `IndexedFold` or `IndexedTraversal` (or `Just` the result from an `IndexedGetter` or `IndexedLens`). See also (`^@?`).

    ipreviews = views . ipre

This is usually applied in the `Reader` `Monad` `(->) s`.

    ipreviews :: IndexedGetter i s a     -> (i -> a -> r) -> s -> Maybe r
    ipreviews :: IndexedFold i s a       -> (i -> a -> r) -> s -> Maybe r
    ipreviews :: IndexedLens' i s a      -> (i -> a -> r) -> s -> Maybe r
    ipreviews :: IndexedTraversal' i s a -> (i -> a -> r) -> s -> Maybe r

However, it may be useful to think of its full generality when working with a `Monad` transformer stack:

    ipreviews :: MonadReader s m => IndexedGetter i s a     -> (i -> a -> r) -> m (Maybe r)
    ipreviews :: MonadReader s m => IndexedFold i s a       -> (i -> a -> r) -> m (Maybe r)
    ipreviews :: MonadReader s m => IndexedLens' i s a      -> (i -> a -> r) -> m (Maybe r)
    ipreviews :: MonadReader s m => IndexedTraversal' i s a -> (i -> a -> r) -> m (Maybe r)

preuse :: MonadState s m => Getting (First a) s a -> m (Maybe a) Source #

Retrieve the first value targeted by a `Fold` or `Traversal` (or `Just` the result from a `Getter` or `Lens`) into the current state.

    preuse = use . pre

    preuse :: MonadState s m => Getter s a     -> m (Maybe a)
    preuse :: MonadState s m => Fold s a       -> m (Maybe a)
    preuse :: MonadState s m => Lens' s a      -> m (Maybe a)
    preuse :: MonadState s m => Iso' s a       -> m (Maybe a)
    preuse :: MonadState s m => Traversal' s a -> m (Maybe a)

ipreuse :: MonadState s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a)) Source #

Retrieve the first index and value targeted by an `IndexedFold` or `IndexedTraversal` (or `Just` the index and result from an `IndexedGetter` or `IndexedLens`) into the current state.

    ipreuse = use . ipre

    ipreuse :: MonadState s m => IndexedGetter i s a     -> m (Maybe (i, a))
    ipreuse :: MonadState s m => IndexedFold i s a       -> m (Maybe (i, a))
    ipreuse :: MonadState s m => IndexedLens' i s a      -> m (Maybe (i, a))
    ipreuse :: MonadState s m => IndexedTraversal' i s a -> m (Maybe (i, a))

preuses :: MonadState s m => Getting (First r) s a -> (a -> r) -> m (Maybe r) Source #

Retrieve a function of the first value targeted by a `Fold` or `Traversal` (or `Just` the result from a `Getter` or `Lens`) into the current state.

    preuses = uses . pre

    preuses :: MonadState s m => Getter s a     -> (a -> r) -> m (Maybe r)
    preuses :: MonadState s m => Fold s a       -> (a -> r) -> m (Maybe r)
    preuses :: MonadState s m => Lens' s a      -> (a -> r) -> m (Maybe r)
    preuses :: MonadState s m => Iso' s a       -> (a -> r) -> m (Maybe r)
    preuses :: MonadState s m => Traversal' s a -> (a -> r) -> m (Maybe r)

ipreuses :: MonadState s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r) Source #

Retrieve a function of the first index and value targeted by an `IndexedFold` or `IndexedTraversal` (or a function of `Just` the index and result from an `IndexedGetter` or `IndexedLens`) into the current state.

    ipreuses = uses . ipre

    ipreuses :: MonadState s m => IndexedGetter i s a     -> (i -> a -> r) -> m (Maybe r)
    ipreuses :: MonadState s m => IndexedFold i s a       -> (i -> a -> r) -> m (Maybe r)
    ipreuses :: MonadState s m => IndexedLens' i s a      -> (i -> a -> r) -> m (Maybe r)
    ipreuses :: MonadState s m => IndexedTraversal' i s a -> (i -> a -> r) -> m (Maybe r)

ifoldrOf :: IndexedGetting i (Endo r) s a -> (i -> a -> r -> r) -> r -> s -> r Source #

Right-associative fold of parts of a structure that are viewed through an `IndexedFold` or `IndexedTraversal` with access to the `i`.

When you don't need access to the index then `foldrOf` is more flexible in what it accepts.

    foldrOf l ≡ ifoldrOf l . const

    ifoldrOf :: IndexedGetter i s a     -> (i -> a -> r -> r) -> r -> s -> r
    ifoldrOf :: IndexedFold i s a       -> (i -> a -> r -> r) -> r -> s -> r
    ifoldrOf :: IndexedLens' i s a      -> (i -> a -> r -> r) -> r -> s -> r
    ifoldrOf :: IndexedTraversal' i s a -> (i -> a -> r -> r) -> r -> s -> r

ifoldlOf :: IndexedGetting i (Dual (Endo r)) s a -> (i -> r -> a -> r) -> r -> s -> r Source #

Left-associative fold of the parts of a structure that are viewed through an `IndexedFold` or `IndexedTraversal` with access to the `i`.

When you don't need access to the index then `foldlOf` is more flexible in what it accepts.

    foldlOf l ≡ ifoldlOf l . const

    ifoldlOf :: IndexedGetter i s a     -> (i -> r -> a -> r) -> r -> s -> r
    ifoldlOf :: IndexedFold i s a       -> (i -> r -> a -> r) -> r -> s -> r
    ifoldlOf :: IndexedLens' i s a      -> (i -> r -> a -> r) -> r -> s -> r
    ifoldlOf :: IndexedTraversal' i s a -> (i -> r -> a -> r) -> r -> s -> r

ianyOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool Source #

Return whether or not any element viewed through an `IndexedFold` or `IndexedTraversal` satisfy a predicate, with access to the `i`.

When you don't need access to the index then `anyOf` is more flexible in what it accepts.

    anyOf l ≡ ianyOf l . const

    ianyOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
    ianyOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
    ianyOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
    ianyOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

iallOf :: IndexedGetting i All s a -> (i -> a -> Bool) -> s -> Bool Source #

Return whether or not all elements viewed through an `IndexedFold` or `IndexedTraversal` satisfy a predicate, with access to the `i`.

When you don't need access to the index then `allOf` is more flexible in what it accepts.

    allOf l ≡ iallOf l . const

    iallOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
    iallOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
    iallOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
    iallOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

inoneOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool Source #

Return whether or not none of the elements viewed through an `IndexedFold` or `IndexedTraversal` satisfy a predicate, with access to the `i`.

When you don't need access to the index then `noneOf` is more flexible in what it accepts.

    noneOf l ≡ inoneOf l . const

    inoneOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
    inoneOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
    inoneOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
    inoneOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

itraverseOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> (i -> a -> f r) -> s -> f () Source #

Traverse the targets of an `IndexedFold` or `IndexedTraversal` with access to the `i`, discarding the results.

When you don't need access to the index then `traverseOf_` is more flexible in what it accepts.

    traverseOf_ l ≡ itraverseOf l . const

    itraverseOf_ :: Functor f     => IndexedGetter i s a     -> (i -> a -> f r) -> s -> f ()
    itraverseOf_ :: Applicative f => IndexedFold i s a       -> (i -> a -> f r) -> s -> f ()
    itraverseOf_ :: Functor f     => IndexedLens' i s a      -> (i -> a -> f r) -> s -> f ()
    itraverseOf_ :: Applicative f => IndexedTraversal' i s a -> (i -> a -> f r) -> s -> f ()

iforOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> s -> (i -> a -> f r) -> f () Source #

Traverse the targets of an `IndexedFold` or `IndexedTraversal` with access to the index, discarding the results (with the arguments flipped).

    iforOf_ ≡ flip . itraverseOf_

When you don't need access to the index then `forOf_` is more flexible in what it accepts.

    forOf_ l a ≡ iforOf_ l a . const

    iforOf_ :: Functor f     => IndexedGetter i s a     -> s -> (i -> a -> f r) -> f ()
    iforOf_ :: Applicative f => IndexedFold i s a       -> s -> (i -> a -> f r) -> f ()
    iforOf_ :: Functor f     => IndexedLens' i s a      -> s -> (i -> a -> f r) -> f ()
    iforOf_ :: Applicative f => IndexedTraversal' i s a -> s -> (i -> a -> f r) -> f ()

imapMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> (i -> a -> m r) -> s -> m () Source #

Run monadic actions for each target of an `IndexedFold` or `IndexedTraversal` with access to the index, discarding the results.

When you don't need access to the index then `mapMOf_` is more flexible in what it accepts.

    mapMOf_ l ≡ imapMOf l . const

    imapMOf_ :: Monad m => IndexedGetter i s a     -> (i -> a -> m r) -> s -> m ()
    imapMOf_ :: Monad m => IndexedFold i s a       -> (i -> a -> m r) -> s -> m ()
    imapMOf_ :: Monad m => IndexedLens' i s a      -> (i -> a -> m r) -> s -> m ()
    imapMOf_ :: Monad m => IndexedTraversal' i s a -> (i -> a -> m r) -> s -> m ()

iforMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> s -> (i -> a -> m r) -> m () Source #

Run monadic actions for each target of an `IndexedFold` or `IndexedTraversal` with access to the index, discarding the results (with the arguments flipped).

    iforMOf_ ≡ flip . imapMOf_

When you don't need access to the index then `forMOf_` is more flexible in what it accepts.

    forMOf_ l a ≡ iforMOf l a . const

    iforMOf_ :: Monad m => IndexedGetter i s a     -> s -> (i -> a -> m r) -> m ()
    iforMOf_ :: Monad m => IndexedFold i s a       -> s -> (i -> a -> m r) -> m ()
    iforMOf_ :: Monad m => IndexedLens' i s a      -> s -> (i -> a -> m r) -> m ()
    iforMOf_ :: Monad m => IndexedTraversal' i s a -> s -> (i -> a -> m r) -> m ()

iconcatMapOf :: IndexedGetting i [r] s a -> (i -> a -> [r]) -> s -> [r] Source #

Concatenate the results of a function of the elements of an `IndexedFold` or `IndexedTraversal` with access to the index.

When you don't need access to the index then `concatMapOf` is more flexible in what it accepts.

    concatMapOf l ≡ iconcatMapOf l . const
    iconcatMapOf ≡ ifoldMapOf

    iconcatMapOf :: IndexedGetter i s a     -> (i -> a -> [r]) -> s -> [r]
    iconcatMapOf :: IndexedFold i s a       -> (i -> a -> [r]) -> s -> [r]
    iconcatMapOf :: IndexedLens' i s a      -> (i -> a -> [r]) -> s -> [r]
    iconcatMapOf :: IndexedTraversal' i s a -> (i -> a -> [r]) -> s -> [r]

ifindOf :: IndexedGetting i (Endo (Maybe a)) s a -> (i -> a -> Bool) -> s -> Maybe a Source #

The `ifindOf` function takes an `IndexedFold` or `IndexedTraversal`, a predicate that is also supplied the index, a structure and returns the left-most element of the structure matching the predicate, or `Nothing` if there is no such element.

When you don't need access to the index then `findOf` is more flexible in what it accepts.

    findOf l ≡ ifindOf l . const

    ifindOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Maybe a
    ifindOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Maybe a
    ifindOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Maybe a
    ifindOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Maybe a

ifindMOf :: Monad m => IndexedGetting i (Endo (m (Maybe a))) s a -> (i -> a -> m Bool) -> s -> m (Maybe a) Source #

The `ifindMOf` function takes an `IndexedFold` or `IndexedTraversal`, a monadic predicate that is also supplied the index, a structure and returns in the monad the left-most element of the structure matching the predicate, or `Nothing` if there is no such element.

When you don't need access to the index then `findMOf` is more flexible in what it accepts.

    findMOf l ≡ ifindMOf l . const

    ifindMOf :: Monad m => IndexedGetter i s a     -> (i -> a -> m Bool) -> s -> m (Maybe a)
    ifindMOf :: Monad m => IndexedFold i s a       -> (i -> a -> m Bool) -> s -> m (Maybe a)
    ifindMOf :: Monad m => IndexedLens' i s a      -> (i -> a -> m Bool) -> s -> m (Maybe a)
    ifindMOf :: Monad m => IndexedTraversal' i s a -> (i -> a -> m Bool) -> s -> m (Maybe a)

ifoldrOf' :: IndexedGetting i (Dual (Endo (r -> r))) s a -> (i -> a -> r -> r) -> r -> s -> r Source #

Strictly fold right over the elements of a structure with an index.

When you don't need access to the index then `foldrOf'` is more flexible in what it accepts.

    foldrOf' l ≡ ifoldrOf' l . const

    ifoldrOf' :: IndexedGetter i s a     -> (i -> a -> r -> r) -> r -> s -> r
    ifoldrOf' :: IndexedFold i s a       -> (i -> a -> r -> r) -> r -> s -> r
    ifoldrOf' :: IndexedLens' i s a      -> (i -> a -> r -> r) -> r -> s -> r
    ifoldrOf' :: IndexedTraversal' i s a -> (i -> a -> r -> r) -> r -> s -> r

ifoldlOf' :: IndexedGetting i (Endo (r -> r)) s a -> (i -> r -> a -> r) -> r -> s -> r Source #

Fold over the elements of a structure with an index, associating to the left, but strictly.

When you don't need access to the index then `foldlOf'` is more flexible in what it accepts.

    foldlOf' l ≡ ifoldlOf' l . const

    ifoldlOf' :: IndexedGetter i s a       -> (i -> r -> a -> r) -> r -> s -> r
    ifoldlOf' :: IndexedFold i s a         -> (i -> r -> a -> r) -> r -> s -> r
    ifoldlOf' :: IndexedLens' i s a        -> (i -> r -> a -> r) -> r -> s -> r
    ifoldlOf' :: IndexedTraversal' i s a   -> (i -> r -> a -> r) -> r -> s -> r

ifoldrMOf :: Monad m => IndexedGetting i (Dual (Endo (r -> m r))) s a -> (i -> a -> r -> m r) -> r -> s -> m r Source #

Monadic fold right over the elements of a structure with an index.

When you don't need access to the index then `foldrMOf` is more flexible in what it accepts.

    foldrMOf l ≡ ifoldrMOf l . const

    ifoldrMOf :: Monad m => IndexedGetter i s a     -> (i -> a -> r -> m r) -> r -> s -> m r
    ifoldrMOf :: Monad m => IndexedFold i s a       -> (i -> a -> r -> m r) -> r -> s -> m r
    ifoldrMOf :: Monad m => IndexedLens' i s a      -> (i -> a -> r -> m r) -> r -> s -> m r
    ifoldrMOf :: Monad m => IndexedTraversal' i s a -> (i -> a -> r -> m r) -> r -> s -> m r

ifoldlMOf :: Monad m => IndexedGetting i (Endo (r -> m r)) s a -> (i -> r -> a -> m r) -> r -> s -> m r Source #

Monadic fold over the elements of a structure with an index, associating to the left.

When you don't need access to the index then `foldlMOf` is more flexible in what it accepts.

    foldlMOf l ≡ ifoldlMOf l . const

    ifoldlMOf :: Monad m => IndexedGetter i s a     -> (i -> r -> a -> m r) -> r -> s -> m r
    ifoldlMOf :: Monad m => IndexedFold i s a       -> (i -> r -> a -> m r) -> r -> s -> m r
    ifoldlMOf :: Monad m => IndexedLens' i s a      -> (i -> r -> a -> m r) -> r -> s -> m r
    ifoldlMOf :: Monad m => IndexedTraversal' i s a -> (i -> r -> a -> m r) -> r -> s -> m r

itoListOf :: IndexedGetting i (Endo [(i, a)]) s a -> s -> [(i, a)] Source #

Extract the key-value pairs from a structure.

When you don't need access to the indices in the result, then `toListOf` is more flexible in what it accepts.

    toListOf l ≡ map snd . itoListOf l

    itoListOf :: IndexedGetter i s a     -> s -> [(i,a)]
    itoListOf :: IndexedFold i s a       -> s -> [(i,a)]
    itoListOf :: IndexedLens' i s a      -> s -> [(i,a)]
    itoListOf :: IndexedTraversal' i s a -> s -> [(i,a)]

(^@..) :: s -> IndexedGetting i (Endo [(i, a)]) s a -> [(i, a)] infixl 8 Source #

An infix version of `itoListOf`.

(^@?) :: s -> IndexedGetting i (Endo (Maybe (i, a))) s a -> Maybe (i, a) infixl 8 Source #

Perform a safe `head` (with index) of an `IndexedFold` or `IndexedTraversal` or retrieve `Just` the index and result from an `IndexedGetter` or `IndexedLens`.

When using a `IndexedTraversal` as a partial `IndexedLens`, or an `IndexedFold` as a partial `IndexedGetter` this can be a convenient way to extract the optional value.

    (^@?) :: s -> IndexedGetter i s a     -> Maybe (i, a)
    (^@?) :: s -> IndexedFold i s a       -> Maybe (i, a)
    (^@?) :: s -> IndexedLens' i s a      -> Maybe (i, a)
    (^@?) :: s -> IndexedTraversal' i s a -> Maybe (i, a)

(^@?!) :: HasCallStack => s -> IndexedGetting i (Endo (i, a)) s a -> (i, a) infixl 8 Source #

Perform an *UNSAFE* `head` (with index) of an `IndexedFold` or `IndexedTraversal` assuming that it is there.

    (^@?!) :: s -> IndexedGetter i s a     -> (i, a)
    (^@?!) :: s -> IndexedFold i s a       -> (i, a)
    (^@?!) :: s -> IndexedLens' i s a      -> (i, a)
    (^@?!) :: s -> IndexedTraversal' i s a -> (i, a)

elemIndexOf :: Eq a => IndexedGetting i (First i) s a -> a -> s -> Maybe i Source #

Retrieve the index of the first value targeted by a `IndexedFold` or `IndexedTraversal` which is equal to a given value.

    elemIndex ≡ elemIndexOf folded

    elemIndexOf :: Eq a => IndexedFold i s a       -> a -> s -> Maybe i
    elemIndexOf :: Eq a => IndexedTraversal' i s a -> a -> s -> Maybe i

elemIndicesOf :: Eq a => IndexedGetting i (Endo [i]) s a -> a -> s -> [i] Source #

Retrieve the indices of the values targeted by a `IndexedFold` or `IndexedTraversal` which are equal to a given value.

    elemIndices ≡ elemIndicesOf folded

    elemIndicesOf :: Eq a => IndexedFold i s a       -> a -> s -> [i]
    elemIndicesOf :: Eq a => IndexedTraversal' i s a -> a -> s -> [i]

findIndexOf :: IndexedGetting i (First i) s a -> (a -> Bool) -> s -> Maybe i Source #

Retrieve the index of the first value targeted by a `IndexedFold` or `IndexedTraversal` which satisfies a predicate.

    findIndex ≡ findIndexOf folded

    findIndexOf :: IndexedFold i s a       -> (a -> Bool) -> s -> Maybe i
    findIndexOf :: IndexedTraversal' i s a -> (a -> Bool) -> s -> Maybe i

findIndicesOf :: IndexedGetting i (Endo [i]) s a -> (a -> Bool) -> s -> [i] Source #

Retrieve the indices of the values targeted by a `IndexedFold` or `IndexedTraversal` which satisfy a predicate.

    findIndices ≡ findIndicesOf folded

    findIndicesOf :: IndexedFold i s a       -> (a -> Bool) -> s -> [i]
    findIndicesOf :: IndexedTraversal' i s a -> (a -> Bool) -> s -> [i]

ifiltered :: (Indexable i p, Applicative f) => (i -> a -> Bool) -> Optical' p (Indexed i) f a a Source #

Filter an `IndexedFold` or `IndexedGetter`, obtaining an `IndexedFold`.

    >>> [0,0,0,5,5,5]^..traversed.ifiltered (\i a -> i <= a)
    [0,5,5,5]

Compose with `ifiltered` to filter another `IndexedLens`, `IndexedIso`, `IndexedGetter`, `IndexedFold` (or `IndexedTraversal`) with access to both the value and the index.

Note: As with `filtered`, this is not a legal `IndexedTraversal`, unless you are very careful not to invalidate the predicate on the target!

itakingWhile :: (Indexable i p, Profunctor q, Contravariant f, Applicative f) => (i -> a -> Bool) -> Optical' (Indexed i) q (Const (Endo (f s)) :: Type -> Type) s a -> Optical' p q f s a Source #

Obtain an `IndexedFold` by taking elements from another `IndexedFold`, `IndexedLens`, `IndexedGetter` or `IndexedTraversal` while a predicate holds.

    itakingWhile :: (i -> a -> Bool) -> IndexedFold i s a          -> IndexedFold i s a
    itakingWhile :: (i -> a -> Bool) -> IndexedTraversal' i s a    -> IndexedFold i s a
    itakingWhile :: (i -> a -> Bool) -> IndexedLens' i s a         -> IndexedFold i s a
    itakingWhile :: (i -> a -> Bool) -> IndexedGetter i s a        -> IndexedFold i s a

Note: Applying `itakingWhile` to an `IndexedLens` or `IndexedTraversal` will still allow you to use it as a pseudo-`IndexedTraversal`, but if you change the value of any target to one where the predicate returns `False`, then you will break the `Traversal` laws and `Traversal` fusion will no longer be sound.

idroppingWhile :: (Indexable i p, Profunctor q, Applicative f) => (i -> a -> Bool) -> Optical (Indexed i) q (Compose (State Bool) f) s t a a -> Optical p q f s t a a Source #

Obtain an `IndexedFold` by dropping elements from another `IndexedFold`, `IndexedLens`, `IndexedGetter` or `IndexedTraversal` while a predicate holds.

    idroppingWhile :: (i -> a -> Bool) -> IndexedFold i s a          -> IndexedFold i s a
    idroppingWhile :: (i -> a -> Bool) -> IndexedTraversal' i s a    -> IndexedFold i s a -- see notes
    idroppingWhile :: (i -> a -> Bool) -> IndexedLens' i s a         -> IndexedFold i s a -- see notes
    idroppingWhile :: (i -> a -> Bool) -> IndexedGetter i s a        -> IndexedFold i s a

Note: As with `droppingWhile` applying `idroppingWhile` to an `IndexedLens` or `IndexedTraversal` will still allow you to use it as a pseudo-`IndexedTraversal`, but if you change the value of the first target to one where the predicate returns `True`, then you will break the `Traversal` laws and `Traversal` fusion will no longer be sound.

foldByOf :: Fold s a -> (a -> a -> a) -> a -> s -> a Source #

Fold a value using a specified `Fold` and `Monoid` operations. This is like `foldBy` where the `Foldable` instance can be manually specified.

    foldByOf folded ≡ foldBy

    foldByOf :: Getter s a     -> (a -> a -> a) -> a -> s -> a
    foldByOf :: Fold s a       -> (a -> a -> a) -> a -> s -> a
    foldByOf :: Lens' s a      -> (a -> a -> a) -> a -> s -> a
    foldByOf :: Traversal' s a -> (a -> a -> a) -> a -> s -> a
    foldByOf :: Iso' s a       -> (a -> a -> a) -> a -> s -> a

    >>> foldByOf both (++) [] ("hello","world")
    "helloworld"

foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r Source #

Fold a value using a specified `Fold` and `Monoid` operations. This is like `foldMapBy` where the `Foldable` instance can be manually specified.

    foldMapByOf folded ≡ foldMapBy

    foldMapByOf :: Getter s a     -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Fold s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Traversal' s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Lens' s a      -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Iso' s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r

    >>> foldMapByOf both (+) 0 length ("hello","world")
    10

traversal :: ((a -> f b) -> s -> f t) -> LensLike f s t a b Source #

Build a `Traversal` by providing a function which specifies the elements you wish to focus.

The caller provides a function of type:

    Applicative f => (a -> f b) -> s -> f t

Which is a higher order function which accepts a "focusing function" and applies it to all desired focuses within `s`, then constructs a `t` using the Applicative instance of `f`.

Only elements which are "focused" using the focusing function will be targeted by the resulting traversal.

For example, we can explicitly write a traversal which targets the first and third elements of a tuple like this:

    firstAndThird :: Traversal (a, x, a) (b, x, b) a b
    firstAndThird = traversal go
      where
        go :: Applicative f => (a -> f b) -> (a, x, a) -> f (b, x, b)
        go focus (a, x, a') = liftA3 (,,) (focus a) (pure x) (focus a')

    >>> (1,"two",3) & firstAndThird *~ 10
    (10,"two",30)

    >>> over firstAndThird length ("one",2,"three")
    (3,2,5)

We can re-use existing `Traversal`s when writing new ones by passing our focusing function along to them. This example re-uses `traverse` to focus all elements in a list which is embedded in a tuple. This traversal could also be written simply as `_2 . traverse`.

    selectNested :: Traversal (x, [a]) (x, [b]) a b
    selectNested = traversal go
      where
        go :: Applicative f => (a -> f b) -> (x, [a]) -> f (x, [b])
        go focus (x, as) = liftA2 (,) (pure x) (traverse focus as)

    >>> selectNested .~ "hello" $ (1,[2,3,4,5])
    (1,["hello","hello","hello","hello"])

    >>> (1,[2,3,4,5]) & selectNested *~ 3
    (1,[6,9,12,15])

Note that the `traversal` function actually just returns the same function you pass to it. The function it accepts is in fact a valid traversal all on its own! The use of `traversal` does nothing except verify that the function it is passed matches the signature of a valid traversal. One could remove the `traversal` combinator from either of the last two examples and use the definition of `go` directly with no change in behaviour.

This function exists for consistency with the `lens`, `prism` and `iso` constructors as well as to serve as a touchpoint for beginners who wish to construct their own traversals but are uncertain how to do so.

sequenceAOf :: LensLike f s t (f b) b -> s -> f t Source #

Evaluate each action in the structure from left to right, and collect the results.

    >>> sequenceAOf both ([1,2],[3,4])
    [(1,3),(1,4),(2,3),(2,4)]

    sequenceA ≡ sequenceAOf traverse ≡ traverse id
    sequenceAOf l ≡ traverseOf l id ≡ l id

    sequenceAOf :: Functor f => Iso s t (f b) b       -> s -> f t
    sequenceAOf :: Functor f => Lens s t (f b) b      -> s -> f t
    sequenceAOf :: Applicative f => Traversal s t (f b) b -> s -> f t

mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t Source #

Map each element of a structure targeted by a `Lens` to a monadic action, evaluate these actions from left to right, and collect the results.

    >>> mapMOf both (\x -> [x, x + 1]) (1,3)
    [(1,3),(1,4),(2,3),(2,4)]

    mapM ≡ mapMOf traverse
    imapMOf l ≡ forM l . Indexed

    mapMOf :: Monad m => Iso s t a b       -> (a -> m b) -> s -> m t
    mapMOf :: Monad m => Lens s t a b      -> (a -> m b) -> s -> m t
    mapMOf :: Monad m => Traversal s t a b -> (a -> m b) -> s -> m t

forMOf :: LensLike (WrappedMonad m) s t a b -> s -> (a -> m b) -> m t Source #

`forMOf` is a flipped version of `mapMOf`, consistent with the definition of `forM`.

    >>> forMOf both (1,3) $ \x -> [x, x + 1]
    [(1,3),(1,4),(2,3),(2,4)]

    forM ≡ forMOf traverse
    forMOf l ≡ flip (mapMOf l)
    iforMOf l s ≡ forM l s . Indexed

    forMOf :: Monad m => Iso s t a b       -> s -> (a -> m b) -> m t
    forMOf :: Monad m => Lens s t a b      -> s -> (a -> m b) -> m t
    forMOf :: Monad m => Traversal s t a b -> s -> (a -> m b) -> m t

sequenceOf :: LensLike (WrappedMonad m) s t (m b) b -> s -> m t Source #

Sequence the (monadic) effects targeted by a `Lens` in a container from left to right.

    >>> sequenceOf each ([1,2],[3,4],[5,6])
    [(1,3,5),(1,3,6),(1,4,5),(1,4,6),(2,3,5),(2,3,6),(2,4,5),(2,4,6)]

    sequence ≡ sequenceOf traverse
    sequenceOf l ≡ mapMOf l id
    sequenceOf l ≡ unwrapMonad . l WrapMonad

    sequenceOf :: Monad m => Iso s t (m b) b       -> s -> m t
    sequenceOf :: Monad m => Lens s t (m b) b      -> s -> m t
    sequenceOf :: Monad m => Traversal s t (m b) b -> s -> m t

transposeOf :: LensLike ZipList s t [a] a -> s -> [t] Source #

This generalizes `transpose` to an arbitrary `Traversal`.

Note: `transpose` handles ragged inputs more intelligently, but for non-ragged inputs:

    >>> transposeOf traverse [[1,2,3],[4,5,6]]
    [[1,4],[2,5],[3,6]]

    transpose ≡ transposeOf traverse

Since every `Lens` is a `Traversal`, we can use this as a form of monadic strength as well:

    transposeOf _2 :: (b, [a]) -> [(b, a)]

mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) Source #

This generalizes `mapAccumR` to an arbitrary `Traversal`.

    mapAccumR ≡ mapAccumROf traverse

`mapAccumROf` accumulates `State` from right to left.

    mapAccumROf :: Iso s t a b       -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    mapAccumROf :: Lens s t a b      -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    mapAccumROf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

    mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) Source #

This generalizes `mapAccumL` to an arbitrary `Traversal`.

    mapAccumL ≡ mapAccumLOf traverse

`mapAccumLOf` accumulates `State` from left to right.

    mapAccumLOf :: Iso s t a b       -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    mapAccumLOf :: Lens s t a b      -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    mapAccumLOf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

    mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    mapAccumLOf l f acc0 s = swap (runState (l (a -> state (acc -> swap (f acc a))) s) acc0)

scanr1Of :: LensLike (Backwards (State (Maybe a))) s t a a -> (a -> a -> a) -> s -> t Source #

This permits the use of `scanr1` over an arbitrary `Traversal` or `Lens`.

    scanr1 ≡ scanr1Of traverse

    scanr1Of :: Iso s t a a       -> (a -> a -> a) -> s -> t
    scanr1Of :: Lens s t a a      -> (a -> a -> a) -> s -> t
    scanr1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t

scanl1Of :: LensLike (State (Maybe a)) s t a a -> (a -> a -> a) -> s -> t Source #

This permits the use of `scanl1` over an arbitrary `Traversal` or `Lens`.

    scanl1 ≡ scanl1Of traverse

    scanl1Of :: Iso s t a a       -> (a -> a -> a) -> s -> t
    scanl1Of :: Lens s t a a      -> (a -> a -> a) -> s -> t
    scanl1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t

loci :: forall a c s b f. Applicative f => (a -> f b) -> Bazaar (->) a c s -> f (Bazaar (->) b c s) Source #

This `Traversal` allows you to `traverse` the individual stores in a `Bazaar`.

iloci :: forall i a c s b p f. (Indexable i p, Applicative f) => p a (f b) -> Bazaar (Indexed i) a c s -> f (Bazaar (Indexed i) b c s) Source #

This `IndexedTraversal` allows you to `traverse` the individual stores in a `Bazaar` with access to their indices.

partsOf :: Functor f => Traversing (->) f s t a a -> LensLike f s t [a] [a] Source #

`partsOf` turns a `Traversal` into a `Lens` that resembles an early version of the `uniplate` (or `biplate`) type.

Note: You should really try to maintain the invariant of the number of children in the list.

    >>> (a,b,c) & partsOf each .~ [x,y,z]
    (x,y,z)

Any extras will be lost. If you do not supply enough, then the remainder will come from the original structure.

    >>> (a,b,c) & partsOf each .~ [w,x,y,z]
    (w,x,y)

    >>> (a,b,c) & partsOf each .~ [x,y]
    (x,y,c)

    >>> ('b', 'a', 'd', 'c') & partsOf each %~ sort
    ('a','b','c','d')

So technically, this is only a `Lens` if you do not change the number of results it returns.

When applied to a `Fold` the result is merely a `Getter`.

    partsOf :: Iso' s a       -> Lens' s [a]
    partsOf :: Lens' s a      -> Lens' s [a]
    partsOf :: Traversal' s a -> Lens' s [a]
    partsOf :: Fold s a       -> Getter s [a]
    partsOf :: Getter s a     -> Getter s [a]

ipartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a a -> Over p f s t [a] [a] Source #

An indexed version of `partsOf` that receives the entire list of indices as its index.

partsOf' :: ATraversal s t a a -> Lens s t [a] [a] Source #

A type-restricted version of `partsOf` that can only be used with a `Traversal`.

ipartsOf' :: forall i p f s t a. (Indexable [i] p, Functor f) => Over (Indexed i) (Bazaar' (Indexed i) a) s t a a -> Over p f s t [a] [a] Source #

A type-restricted version of `ipartsOf` that can only be used with an `IndexedTraversal`.

unsafePartsOf :: Functor f => Traversing (->) f s t a b -> LensLike f s t [a] [b] Source #

`unsafePartsOf` turns a `Traversal` into a `uniplate` (or `biplate`) family.

If you do not need the types of `s` and `t` to be different, it is recommended that you use `partsOf`.

It is generally safer to traverse with the `Bazaar` rather than use this combinator. However, it is sometimes convenient.

This is unsafe because if you don't supply at least as many `b`'s as you were given `a`'s, then the reconstruction of `t` will result in an error!

When applied to a `Fold` the result is merely a `Getter` (and becomes safe).

    unsafePartsOf :: Iso s t a b       -> Lens s t [a] [b]
    unsafePartsOf :: Lens s t a b      -> Lens s t [a] [b]
    unsafePartsOf :: Traversal s t a b -> Lens s t [a] [b]
    unsafePartsOf :: Fold s a          -> Getter s [a]
    unsafePartsOf :: Getter s a        -> Getter s [a]

iunsafePartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a b -> Over p f s t [a] [b] Source #

An indexed version of `unsafePartsOf` that receives the entire list of indices as its index.

unsafePartsOf' :: ATraversal s t a b -> Lens s t [a] [b] Source #

iunsafePartsOf' :: forall i s t a b. Over (Indexed i) (Bazaar (Indexed i) a b) s t a b -> IndexedLens [i] s t [a] [b] Source #

unsafeSingular :: (HasCallStack, Conjoined p, Functor f) => Traversing p f s t a b -> Over p f s t a b Source #

This converts a `Traversal` that you "know" will target only one element to a `Lens`. It can also be used to transform a `Fold` into a `Getter`.

The resulting `Lens` or `Getter` will be partial if the `Traversal` targets nothing or more than one element.

    >>> Left (ErrorCall "unsafeSingular: empty traversal") <- try (evaluate ([] & unsafeSingular traverse .~ 0)) :: IO (Either ErrorCall [Integer])

    unsafeSingular :: Traversal s t a b          -> Lens s t a b
    unsafeSingular :: Fold s a                   -> Getter s a
    unsafeSingular :: IndexedTraversal i s t a b -> IndexedLens i s t a b
    unsafeSingular :: IndexedFold i s a          -> IndexedGetter i s a

holesOf :: Conjoined p => Over p (Bazaar p a a) s t a a -> s -> [Pretext p a a t] Source #

The one-level version of `contextsOf`. This extracts a list of the immediate children according to a given `Traversal` as editable contexts.

Given a context you can use `pos` to see the values, `peek` at what the structure would be like with an edited result, or simply `extract` the original structure.

    propChildren l x = toListOf l x == map pos (holesOf l x)
    propId l x = all (== x) [extract w | w <- holesOf l x]

    holesOf :: Iso' s a                -> s -> [Pretext' (->) a s]
    holesOf :: Lens' s a               -> s -> [Pretext' (->) a s]
    holesOf :: Traversal' s a          -> s -> [Pretext' (->) a s]
    holesOf :: IndexedLens' i s a      -> s -> [Pretext' (Indexed i) a s]
    holesOf :: IndexedTraversal' i s a -> s -> [Pretext' (Indexed i) a s]

holes1Of :: Conjoined p => Over p (Bazaar1 p a a) s t a a -> s -> NonEmpty (Pretext p a a t) Source #

The non-empty version of `holesOf`. This extract a non-empty list of immediate children according to a given `Traversal1` as editable contexts.

    >>> let head1 f s = runPretext (NonEmpty.head $ holes1Of traversed1 s) f
    >>> ('a' :| "bc") ^. head1
    'a'

    >>> ('a' :| "bc") & head1 %~ toUpper
    'A' :| "bc"

    holes1Of :: Iso' s a                 -> s -> NonEmpty (Pretext' (->) a s)
    holes1Of :: Lens' s a                -> s -> NonEmpty (Pretext' (->) a s)
    holes1Of :: Traversal1' s a          -> s -> NonEmpty (Pretext' (->) a s)
    holes1Of :: IndexedLens' i s a       -> s -> NonEmpty (Pretext' (Indexed i) a s)
    holes1Of :: IndexedTraversal1' i s a -> s -> NonEmpty (Pretext' (Indexed i) a s)

both :: forall (r :: Type -> Type -> Type) a b. Bitraversable r => Traversal (r a a) (r b b) a b Source #

Traverse both parts of a `Bitraversable` container with matching types.

Usually that type will be a pair. Use `each` to traverse the elements of arbitrary homogeneous tuples.

    >>> (1,2) & both *~ 10
    (10,20)

    >>> over both length ("hello","world")
    (5,5)

    >>> ("hello","world")^.both
    "helloworld"

    both :: Traversal (a, a)       (b, b)       a b
    both :: Traversal (Either a a) (Either b b) a b

both1 :: forall (r :: Type -> Type -> Type) a b. Bitraversable1 r => Traversal1 (r a a) (r b b) a b Source #

Traverse both parts of a `Bitraversable1` container with matching types.

Usually that type will be a pair.

    both1 :: Traversal1 (a, a)       (b, b)       a b
    both1 :: Traversal1 (Either a a) (Either b b) a b

cloneIndexPreservingTraversal :: ATraversal s t a b -> IndexPreservingTraversal s t a b Source #

Clone a `Traversal` yielding an `IndexPreservingTraversal` that passes through whatever index it is composed with.

cloneIndexedTraversal :: AnIndexedTraversal i s t a b -> IndexedTraversal i s t a b Source #

Clone an `IndexedTraversal` yielding an `IndexedTraversal` with the same index.

cloneTraversal1 :: ATraversal1 s t a b -> Traversal1 s t a b Source #

A `Traversal1` is completely characterized by its behavior on a `Bazaar1`.

cloneIndexPreservingTraversal1 :: ATraversal1 s t a b -> IndexPreservingTraversal1 s t a b Source #

Clone a `Traversal1` yielding an `IndexPreservingTraversal1` that passes through whatever index it is composed with.

cloneIndexedTraversal1 :: AnIndexedTraversal1 i s t a b -> IndexedTraversal1 i s t a b Source #

Clone an `IndexedTraversal1` yielding an `IndexedTraversal1` with the same index.

iforOf :: (Indexed i a (f b) -> s -> f t) -> s -> (i -> a -> f b) -> f t Source #

Traverse with an index (and the arguments flipped).

    forOf l a ≡ iforOf l a . const
    iforOf ≡ flip . itraverseOf

    iforOf :: Functor f     => IndexedLens i s t a b       -> s -> (i -> a -> f b) -> f t
    iforOf :: Applicative f => IndexedTraversal i s t a b  -> s -> (i -> a -> f b) -> f t
    iforOf :: Apply f       => IndexedTraversal1 i s t a b -> s -> (i -> a -> f b) -> f t

imapAccumROf :: Over (Indexed i) (Backwards (State acc)) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t) Source #

Generalizes `mapAccumR` to an arbitrary `IndexedTraversal` with access to the index.

`imapAccumROf` accumulates state from right to left.

    mapAccumROf l ≡ imapAccumROf l . const

    imapAccumROf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    imapAccumROf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

imapAccumLOf :: Over (Indexed i) (State acc) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t) Source #

Generalizes `mapAccumL` to an arbitrary `IndexedTraversal` with access to the index.

`imapAccumLOf` accumulates state from left to right.

    mapAccumLOf l ≡ imapAccumLOf l . const

    imapAccumLOf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    imapAccumLOf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

traversed1 :: forall (f :: Type -> Type) a b. Traversable1 f => IndexedTraversal1 Int (f a) (f b) a b Source #

Traverse any `Traversable1` container. This is an `IndexedTraversal1` that is indexed by ordinal position.

traversed64 :: forall (f :: Type -> Type) a b. Traversable f => IndexedTraversal Int64 (f a) (f b) a b Source #

Traverse any `Traversable` container. This is an `IndexedTraversal` that is indexed by ordinal position.

ignored :: Applicative f => pafb -> s -> f s Source #

This is the trivial empty `Traversal`.

    ignored :: IndexedTraversal i s s a b

    ignored ≡ const pure

    >>> 6 & ignored %~ absurd
    6

elementOf :: forall (f :: Type -> Type) s t a. Applicative f => LensLike (Indexing f) s t a a -> Int -> IndexedLensLike Int f s t a a Source #

Traverse the nth `elementOf` a `Traversal`, `Lens` or `Iso` if it exists.

    >>> [[1],[3,4]] & elementOf (traverse.traverse) 1 .~ 5
    [[1],[5,4]]

    >>> [[1],[3,4]] ^? elementOf (folded.folded) 1
    Just 3

    >>> timingOut $ ['a'..] ^?! elementOf folded 5
    'f'

    >>> timingOut $ take 10 $ elementOf traverse 3 .~ 16 $ [0..]
    [0,1,2,16,4,5,6,7,8,9]

    elementOf :: Traversal' s a -> Int -> IndexedTraversal' Int s a
    elementOf :: Fold s a       -> Int -> IndexedFold Int s a

element :: forall (t :: Type -> Type) a. Traversable t => Int -> IndexedTraversal' Int (t a) a Source #

Traverse the nth element of a `Traversable` container.

    element ≡ elementOf traverse

elementsOf :: forall (f :: Type -> Type) s t a. Applicative f => LensLike (Indexing f) s t a a -> (Int -> Bool) -> IndexedLensLike Int f s t a a Source #

Traverse (or fold) selected elements of a `Traversal` (or `Fold`) where their ordinal positions match a predicate.

    elementsOf :: Traversal' s a -> (Int -> Bool) -> IndexedTraversal' Int s a
    elementsOf :: Fold s a       -> (Int -> Bool) -> IndexedFold Int s a

elements :: forall (t :: Type -> Type) a. Traversable t => (Int -> Bool) -> IndexedTraversal' Int (t a) a Source #

Traverse elements of a `Traversable` container where their ordinal positions match a predicate.

    elements ≡ elementsOf traverse

failover :: Alternative m => LensLike ((,) Any) s t a b -> (a -> b) -> s -> m t Source #

Try to map a function over this `Traversal`, failing if the `Traversal` has no targets.

    >>> failover (element 3) (*2) [1,2] :: Maybe [Int]
    Nothing

    >>> failover _Left (*2) (Right 4) :: Maybe (Either Int Int)
    Nothing

    >>> failover _Right (*2) (Right 4) :: Maybe (Either Int Int)
    Just (Right 8)

    failover :: Alternative m => Traversal s t a b -> (a -> b) -> s -> m t

ifailover :: Alternative m => Over (Indexed i) ((,) Any) s t a b -> (i -> a -> b) -> s -> m t Source #

Try to map a function which uses the index over this `IndexedTraversal`, failing if the `IndexedTraversal` has no targets.

    ifailover :: Alternative m => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> m t

deepOf :: (Conjoined p, Applicative f) => LensLike f s t s t -> Traversing p f s t a b -> Over p f s t a b Source #

Try the second traversal. If it returns no entries, try again with all entries from the first traversal, recursively.

    deepOf :: Fold s s          -> Fold s a                   -> Fold s a
    deepOf :: Traversal' s s    -> Traversal' s a             -> Traversal' s a
    deepOf :: Traversal s t s t -> Traversal s t a b          -> Traversal s t a b
    deepOf :: Fold s s          -> IndexedFold i s a          -> IndexedFold i s a
    deepOf :: Traversal s t s t -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b

confusing :: Applicative f => LensLike (Curried (Yoneda f) (Yoneda f)) s t a b -> LensLike f s t a b Source #

Fuse a `Traversal` by reassociating all of the `(`<*>`)` operations to the left and fusing all of the `fmap` calls into one. This is particularly useful when constructing a `Traversal` using operations from GHC.Generics.

Given a pair of `Traversal`s `foo` and `bar`,

    confusing (foo.bar) = foo.bar

However, `foo` and `bar` are each going to use the `Applicative` they are given.

`confusing` exploits the `Yoneda` lemma to merge their separate uses of `fmap` into a single `fmap`. and it further exploits an interesting property of the right Kan lift (or `Curried`) to left associate all of the uses of `(`<*>`)` to make it possible to fuse together more fmaps.

This is particularly effective when the choice of functor `f` is unknown at compile time or when the `Traversal` `foo.bar` in the above description is recursive or complex enough to prevent inlining.

`fusing` is a version of this combinator suitable for fusing lenses.

    confusing :: Traversal s t a b -> Traversal s t a b

traverseByOf :: Traversal s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> s -> f t Source #

Traverse a container using a specified `Applicative`.

This is like `traverseBy` where the `Traversable` instance can be specified by any `Traversal`

    traverseByOf traverse ≡ traverseBy

sequenceByOf :: Traversal s t (f b) b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> s -> f t Source #

Sequence a container using a specified `Applicative`.

This is like `traverseBy` where the `Traversable` instance can be specified by any `Traversal`

    sequenceByOf traverse ≡ sequenceBy

ilevels :: forall (f :: Type -> Type) i s t a b j. Applicative f => Traversing (Indexed i) f s t a b -> IndexedLensLike Int f s t (Level i a) (Level j b) Source #

This provides a breadth-first `Traversal` or `Fold` of the individual levels of any other `Traversal` or `Fold` via iterative deepening depth-first search. The levels are returned to you in a compressed format.

This is similar to `levels`, but retains the index of the original `IndexedTraversal`, so you can access it when traversing the levels later on.

    >>> ["dog","cat"]^@..ilevels (traversed<.>traversed).itraversed
    [((0,0),'d'),((0,1),'o'),((1,0),'c'),((0,2),'g'),((1,1),'a'),((1,2),'t')]

The resulting `Traversal` of the levels which is indexed by the depth of each `Level`.

    >>> ["dog","cat"]^@..ilevels (traversed<.>traversed)<.>itraversed
    [((2,(0,0)),'d'),((3,(0,1)),'o'),((3,(1,0)),'c'),((4,(0,2)),'g'),((4,(1,1)),'a'),((5,(1,2)),'t')]

    ilevels :: IndexedTraversal i s t a b      -> IndexedTraversal Int s t (Level i a) (Level i b)
    ilevels :: IndexedFold i s a               -> IndexedFold Int s (Level i a)

Note: Internally this is implemented by using an illegal `Applicative`, as it extracts information in an order that violates the `Applicative` laws.

(<.) :: Indexable i p => (Indexed i s t -> r) -> ((a -> b) -> s -> t) -> p a b -> r infixr 9 Source #

Compose an `Indexed` function with a non-indexed function.

Mnemonically, the `<` points to the indexing we want to preserve.

    >>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])]
    >>> nestedMap^..(itraversed<.itraversed).withIndex
    [(1,"one,ten"),(1,"one,twenty"),(2,"two,thirty"),(2,"two,forty")]

selfIndex :: Indexable a p => p a fb -> a -> fb Source #

Use a value itself as its own index. This is essentially an indexed version of `id`.

Note: When used to modify the value, this can break the index requirements assumed by `indices` and similar, so this is only properly an `IndexedGetter`, but it can be used as more.

    selfIndex :: IndexedGetter a a b

reindexed :: Indexable j p => (i -> j) -> (Indexed i a b -> r) -> p a b -> r Source #

Remap the index.

icompose :: Indexable p c => (i -> j -> p) -> (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> c a b -> r Source #

Composition of `Indexed` functions with a user supplied function for combining indices.

imapped :: forall i (f :: Type -> Type) a b. FunctorWithIndex i f => IndexedSetter i (f a) (f b) a b Source #

The `IndexedSetter` for a `FunctorWithIndex`.

If you don't need access to the index, then `mapped` is more flexible in what it accepts.

ifolded :: forall i (f :: Type -> Type) a. FoldableWithIndex i f => IndexedFold i (f a) a Source #

The `IndexedFold` of a `FoldableWithIndex` container.

``ifolded` `.` `asIndex`` is a fold over the keys of a `FoldableWithIndex`.

    >>> Data.Map.fromList [(2, "hello"), (1, "world")]^..ifolded.asIndex
    [1,2]

itraversed :: forall i (t :: Type -> Type) a b. TraversableWithIndex i t => IndexedTraversal i (t a) (t b) a b Source #

The `IndexedTraversal` of a `TraversableWithIndex` container.

ifoldMapBy :: FoldableWithIndex i t => (r -> r -> r) -> r -> (i -> a -> r) -> t a -> r Source #

ifoldMapByOf :: IndexedFold i t a -> (r -> r -> r) -> r -> (i -> a -> r) -> t -> r Source #

itraverseBy :: TraversableWithIndex i t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> t a -> f (t b) Source #

itraverseByOf :: IndexedTraversal i s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> s -> f t Source #

runEq :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2). AnEquality s t a b -> Identical s t a b Source #

Extract a witness of type `Equality`.

substEq :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) (rep :: RuntimeRep) (r :: TYPE rep). AnEquality s t a b -> ((s ~ a, t ~ b) => r) -> r Source #

Substituting types with `Equality`.

mapEq :: forall k1 k2 (s :: k1) (t :: k2) (a :: k1) (b :: k2) f. AnEquality s t a b -> f s -> f a Source #

We can use `Equality` to do substitution into anything.

fromEq :: forall {k2} {k1} (s :: k2) (t :: k1) (a :: k2) (b :: k1). AnEquality s t a b -> Equality b a t s Source #

`Equality` is symmetric.

simply :: forall {k} {k1} p (f :: k -> k1) (s :: k) (a :: k) (rep :: RuntimeRep) (r :: TYPE rep). (Optic' p f s a -> r) -> Optic' p f s a -> r Source #

This is an adverb that can be used to modify many other `Lens` combinators to make them require simple lenses, simple traversals, simple prisms or simple isos as input.

simple :: forall {k2} (a :: k2) k3 p (f :: k2 -> k3). p a (f a) -> p a (f a) Source #

Composition with this isomorphism is occasionally useful when your `Lens`, `Traversal` or `Iso` has a constraint on an unused argument to force that argument to agree with the type of a used argument and avoid `ScopedTypeVariables` or other ugliness.

cloneEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2). AnEquality s t a b -> Equality s t a b Source #

equality :: forall {k1} {k2} (s :: k1) (a :: k1) (b :: k2) (t :: k2). (s :~: a) -> (b :~: t) -> Equality s t a b Source #

Construct an `Equality` from explicit equality evidence.

equality' :: forall {k2} (a :: k2) (b :: k2). (a :~: b) -> Equality' a b Source #

A `Simple` version of `equality`

overEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) p. AnEquality s t a b -> p a b -> p s t Source #

Recover a "profunctor lens" form of equality. Reverses `fromLeibniz`.

underEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) p. AnEquality s t a b -> p t s -> p b a Source #

The opposite of working `overEquality` is working `underEquality`.

fromLeibniz :: forall {k1} {k2} (a :: k1) (b :: k2) (s :: k1) (t :: k2). (Identical a b a b -> Identical a b s t) -> Equality s t a b Source #

Convert a "profunctor lens" form of equality to an equality. Reverses `overEquality`.

The type should be understood as

    fromLeibniz :: (forall p. p a b -> p s t) -> Equality s t a b

fromLeibniz' :: forall {k2} (s :: k2) (a :: k2). ((s :~: s) -> s :~: a) -> Equality' s a Source #

Convert Leibniz equality to equality. Reverses `mapEq` in `Simple` cases.

The type should be understood as

    fromLeibniz' :: (forall f. f s -> f a) -> Equality' s a

withEquality :: forall {k1} {k2} (s :: k1) (t :: k2) (a :: k1) (b :: k2) (rep :: RuntimeRep) (r :: TYPE rep). AnEquality s t a b -> ((s :~: a) -> (b :~: t) -> r) -> r Source #

A version of `substEq` that provides explicit, rather than implicit, equality evidence.

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

Build a simple isomorphism from a pair of inverse functions.

    view (iso f g) ≡ f
    view (from (iso f g)) ≡ g
    over (iso f g) h ≡ g . h . f
    over (from (iso f g)) h ≡ f . h . g

withIso :: forall s t a b (rep :: RuntimeRep) (r :: TYPE rep). AnIso 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`.

cloneIso :: AnIso s t a b -> Iso s t a b Source #

Convert from `AnIso` back to any `Iso`.

This is useful when you need to store an isomorphism as a data type inside a container and later reconstitute it as an overloaded function.

See `cloneLens` or `cloneTraversal` for more information on why you might want to do this.

au :: Functor f => AnIso s t a b -> ((b -> t) -> f s) -> f a Source #

Based on `ala` from Conor McBride's work on Epigram.

This version is generalized to accept any `Iso`, not just a `newtype`.

    >>> au (_Wrapping Sum) foldMap [1,2,3,4]
    10

You may want to think of this combinator as having the following, simpler type:

    au :: AnIso s t a b -> ((b -> t) -> e -> s) -> e -> a

    au = xplat . from

auf :: (Functor f, Functor g) => AnIso s t a b -> (f t -> g s) -> f b -> g a Source #

Based on `ala'` from Conor McBride's work on Epigram.

This version is generalized to accept any `Iso`, not just a `newtype`.

For a version you pass the name of the `newtype` constructor to, see `alaf`.

    >>> auf (_Wrapping Sum) (foldMapOf both) Prelude.length ("hello","world")
    10

Mnemonically, the German auf plays a similar role to à la, and the combinator is `au` with an extra function argument:

    auf :: Iso s t a b -> ((r -> t) -> e -> s) -> (r -> b) -> e -> a

but the signature is general.

Note: The direction of the `Iso` required for this function changed in `lens` 4.18 to match up with the behavior of `au`. For the old behavior use `xplatf` or for a version that is compatible across both old and new versions of `lens` you can just use `coerce`!

xplat :: forall {k2} s g (t :: k2) a (b :: k2). Optic (Costar ((->) s)) g s t a b -> ((s -> a) -> g b) -> g t Source #

``xplat` = `au` . `from`` but with a nicer signature.

xplatf :: forall {k} {k2} f g (s :: k) (t :: k2) (a :: k) (b :: k2). Optic (Costar f) g s t a b -> (f a -> g b) -> f s -> g t Source #

``xplatf` = `auf` . `from`` but with a nicer signature.

    >>> xplatf (_Unwrapping Sum) (foldMapOf both) Prelude.length ("hello","world")
    10

    xplatf :: Iso s t a b -> ((r -> a) -> e -> b) -> (r -> s) -> e -> t

under :: AnIso s t a b -> (t -> s) -> b -> a Source #

The opposite of working `over` a `Setter` is working `under` an isomorphism.

    under ≡ over . from

    under :: Iso s t a b -> (t -> s) -> b -> a

enum :: Enum a => Iso' Int a Source #

This isomorphism can be used to convert to or from an instance of `Enum`.

    >>> LT^.from enum
    0

    >>> 97^.enum :: Char
    'a'

Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable `Enum` instances for `Double`, and `Float` that exist solely for `[1.0 .. 4.0]` sugar and the instances for those and `Integer` don't cover all values in their range.

mapping :: forall (f :: Type -> Type) (g :: Type -> Type) s t a b. (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b) Source #

This can be used to lift any `Iso` into an arbitrary `Functor`.

non :: Eq a => a -> Iso' (Maybe a) a Source #

If `v` is an element of a type `a`, and `a'` is `a` sans the element `v`, then ``non` v` is an isomorphism from ``Maybe` a'` to `a`.

    non ≡ non' . only

Keep in mind this is only a real isomorphism if you treat the domain as being ``Maybe` (a sans v)`.

This is practically quite useful when you want to have a `Map` where all the entries should have non-zero values.

    >>> Map.fromList [("hello",1)] & at "hello" . non 0 +~ 2
    fromList [("hello",3)]

    >>> Map.fromList [("hello",1)] & at "hello" . non 0 -~ 1
    fromList []

    >>> Map.fromList [("hello",1)] ^. at "hello" . non 0
    1

    >>> Map.fromList [] ^. at "hello" . non 0
    0

This combinator is also particularly useful when working with nested maps.

e.g. When you want to create the nested `Map` when it is missing:

    >>> Map.empty & at "hello" . non Map.empty . at "world" ?~ "!!!"
    fromList [("hello",fromList [("world","!!!")])]

and when have deleting the last entry from the nested `Map` mean that we should delete its entry from the surrounding one:

    >>> Map.fromList [("hello",Map.fromList [("world","!!!")])] & at "hello" . non Map.empty . at "world" .~ Nothing
    fromList []

It can also be used in reverse to exclude a given value:

    >>> non 0 # rem 10 4
    Just 2

    >>> non 0 # rem 10 5
    Nothing

non' :: APrism' a () -> Iso' (Maybe a) a Source #

``non'` p` generalizes ``non` (p # ())` to take any unit `Prism`

This function generates an isomorphism between ``Maybe` (a | `isn't` p a)` and `a`.

    >>> Map.singleton "hello" Map.empty & at "hello" . non' _Empty . at "world" ?~ "!!!"
    fromList [("hello",fromList [("world","!!!")])]

    >>> Map.fromList [("hello",Map.fromList [("world","!!!")])] & at "hello" . non' _Empty . at "world" .~ Nothing
    fromList []

anon :: a -> (a -> Bool) -> Iso' (Maybe a) a Source #

``anon` a p` generalizes ``non` a` to take any value and a predicate.

This function assumes that `p a` holds ``True`` and generates an isomorphism between ``Maybe` (a | `not` (p a))` and `a`.

    >>> Map.empty & at "hello" . anon Map.empty Map.null . at "world" ?~ "!!!"
    fromList [("hello",fromList [("world","!!!")])]

    >>> Map.fromList [("hello",Map.fromList [("world","!!!")])] & at "hello" . anon Map.empty Map.null . at "world" .~ Nothing
    fromList []

curried :: forall a b c d e f1 p f2. (Profunctor p, Functor f2) => p (a -> b -> c) (f2 (d -> e -> f1)) -> p ((a, b) -> c) (f2 ((d, e) -> f1)) Source #

The canonical isomorphism for currying and uncurrying a function.

    curried = iso curry uncurry

    >>> (fst^.curried) 3 4
    3

    >>> view curried fst 3 4
    3

uncurried :: forall a b c d e f1 p f2. (Profunctor p, Functor f2) => p ((a, b) -> c) (f2 ((d, e) -> f1)) -> p (a -> b -> c) (f2 (d -> e -> f1)) Source #

The canonical isomorphism for uncurrying and currying a function.

    uncurried = iso uncurry curry

    uncurried = from curried

    >>> ((+)^.uncurried) (1,2)
    3

flipped :: forall a b c a' b' c' p f. (Profunctor p, Functor f) => p (b -> a -> c) (f (b' -> a' -> c')) -> p (a -> b -> c) (f (a' -> b' -> c')) Source #

The isomorphism for flipping a function.

    >>> ((,)^.flipped) 1 2
    (2,1)

swapped :: forall (p :: Type -> Type -> Type) a b c d. Swap p => Iso (p a b) (p c d) (p b a) (p d c) Source #

    swapped . swapped ≡ id
    first f . swapped = swapped . second f
    second g . swapped = swapped . first g
    bimap f g . swapped = swapped . bimap g f

    >>> (1,2)^.swapped
    (2,1)

reversed :: Reversing a => Iso' a a Source #

An `Iso` between a list, `ByteString`, `Text` fragment, etc. and its reversal.

    >>> "live" ^. reversed
    "evil"

    >>> "live" & reversed %~ ('d':)
    "lived"

involuted :: (a -> a) -> Iso' a a Source #

Given a function that is its own inverse, this gives you an `Iso` using it in both directions.

    involuted ≡ join iso

    >>> "live" ^. involuted reverse
    "evil"

    >>> "live" & involuted reverse %~ ('d':)
    "lived"

magma :: LensLike (Mafic a b) s t a b -> Iso s u (Magma Int t b a) (Magma j u c c) Source #

This isomorphism can be used to inspect a `Traversal` to see how it associates the structure and it can also be used to bake the `Traversal` into a `Magma` so that you can traverse over it multiple times.

imagma :: Over (Indexed i) (Molten i a b) s t a b -> Iso s t' (Magma i t b a) (Magma j t' c c) Source #

This isomorphism can be used to inspect an `IndexedTraversal` to see how it associates the structure and it can also be used to bake the `IndexedTraversal` into a `Magma` so that you can traverse over it multiple times with access to the original indices.

contramapping :: forall (f :: Type -> Type) s t a b. Contravariant f => AnIso s t a b -> Iso (f a) (f b) (f s) (f t) Source #

Lift an `Iso` into a `Contravariant` functor.

    contramapping :: Contravariant f => Iso s t a b -> Iso (f a) (f b) (f s) (f t)
    contramapping :: Contravariant f => Iso' s a -> Iso' (f a) (f s)

dimapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b s' t' a' b'. (Profunctor p, Profunctor q) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (p a s') (q b t') (p s a') (q t b') Source #

Lift two `Iso`s into both arguments of a `Profunctor` simultaneously.

    dimapping :: Profunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p a s') (p b t') (p s a') (p t b')
    dimapping :: Profunctor p => Iso' s a -> Iso' s' a' -> Iso' (p a s') (p s a')

lmapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b x y. (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p a x) (q b y) (p s x) (q t y) Source #

Lift an `Iso` contravariantly into the left argument of a `Profunctor`.

    lmapping :: Profunctor p => Iso s t a b -> Iso (p a x) (p b y) (p s x) (p t y)
    lmapping :: Profunctor p => Iso' s a -> Iso' (p a x) (p s x)

rmapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b x y. (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p x s) (q y t) (p x a) (q y b) Source #

Lift an `Iso` covariantly into the right argument of a `Profunctor`.

    rmapping :: Profunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
    rmapping :: Profunctor p => Iso' s a -> Iso' (p x s) (p x a)

bimapping :: forall (f :: Type -> Type -> Type) (g :: Type -> Type -> Type) s t a b s' t' a' b'. (Bifunctor f, Bifunctor g) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (f s s') (g t t') (f a a') (g b b') Source #

Lift two `Iso`s into both arguments of a `Bifunctor`.

    bimapping :: Bifunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p s s') (p t t') (p a a') (p b b')
    bimapping :: Bifunctor p => Iso' s a -> Iso' s' a' -> Iso' (p s s') (p a a')

firsting :: forall (f :: Type -> Type -> Type) (g :: Type -> Type -> Type) s t a b x y. (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f s x) (g t y) (f a x) (g b y) Source #

Lift an `Iso` into the first argument of a `Bifunctor`.

    firsting :: Bifunctor p => Iso s t a b -> Iso (p s x) (p t y) (p a x) (p b y)
    firsting :: Bifunctor p => Iso' s a -> Iso' (p s x) (p a x)

seconding :: forall (f :: Type -> Type -> Type) (g :: Type -> Type -> Type) s t a b x y. (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f x s) (g y t) (f x a) (g y b) Source #

Lift an `Iso` into the second argument of a `Bifunctor`. This is essentially the same as `mapping`, but it takes a 'Bifunctor p' constraint instead of a 'Functor (p a)' one.

    seconding :: Bifunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
    seconding :: Bifunctor p => Iso' s a -> Iso' (p x s) (p x a)

coerced :: forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b Source #

Data types that are representationally equal are isomorphic.

This is only available on GHC 7.8+

Since: lens-4.13

_head :: Cons s s a a => Traversal' s a Source #

A `Traversal` reading and writing to the `head` of a non-empty container.

    >>> [a,b,c]^? _head
    Just a

    >>> [a,b,c] & _head .~ d
    [d,b,c]

    >>> [a,b,c] & _head %~ f
    [f a,b,c]

    >>> [] & _head %~ f
    []

    >>> [1,2,3]^?!_head
    1

    >>> []^?_head
    Nothing

    >>> [1,2]^?_head
    Just 1

    >>> [] & _head .~ 1
    []

    >>> [0] & _head .~ 2
    [2]

    >>> [0,1] & _head .~ 2
    [2,1]

This isn't limited to lists.

For instance you can also `traverse` the head of a `Seq`:

    >>> Seq.fromList [a,b,c,d] & _head %~ f
    fromList [f a,b,c,d]

    >>> Seq.fromList [] ^? _head
    Nothing

    >>> Seq.fromList [a,b,c,d] ^? _head
    Just a

    _head :: Traversal' [a] a
    _head :: Traversal' (Seq a) a
    _head :: Traversal' (Vector a) a

_tail :: Cons s s a a => Traversal' s s Source #

A `Traversal` reading and writing to the `tail` of a non-empty container.

    >>> [a,b] & _tail .~ [c,d,e]
    [a,c,d,e]

    >>> [] & _tail .~ [a,b]
    []

    >>> [a,b,c,d,e] & _tail.traverse %~ f
    [a,f b,f c,f d,f e]

    >>> [1,2] & _tail .~ [3,4,5]
    [1,3,4,5]

    >>> [] & _tail .~ [1,2]
    []

    >>> [a,b,c]^?_tail
    Just [b,c]

    >>> [1,2]^?!_tail
    [2]

    >>> "hello"^._tail
    "ello"

    >>> ""^._tail
    ""

This isn't limited to lists. For instance you can also `traverse` the tail of a `Seq`.

    >>> Seq.fromList [a,b] & _tail .~ Seq.fromList [c,d,e]
    fromList [a,c,d,e]

    >>> Seq.fromList [a,b,c] ^? _tail
    Just (fromList [b,c])

    >>> Seq.fromList [] ^? _tail
    Nothing

    _tail :: Traversal' [a] [a]
    _tail :: Traversal' (Seq a) (Seq a)
    _tail :: Traversal' (Vector a) (Vector a)

_init :: Snoc s s a a => Traversal' s s Source #

A `Traversal` reading and replacing all but the a last element of a non-empty container.

    >>> [a,b,c,d]^?_init
    Just [a,b,c]

    >>> []^?_init
    Nothing

    >>> [a,b] & _init .~ [c,d,e]
    [c,d,e,b]

    >>> [] & _init .~ [a,b]
    []

    >>> [a,b,c,d] & _init.traverse %~ f
    [f a,f b,f c,d]

    >>> [1,2,3]^?_init
    Just [1,2]

    >>> [1,2,3,4]^?!_init
    [1,2,3]

    >>> "hello"^._init
    "hell"

    >>> ""^._init
    ""

    _init :: Traversal' [a] [a]
    _init :: Traversal' (Seq a) (Seq a)
    _init :: Traversal' (Vector a) (Vector a)

_last :: Snoc s s a a => Traversal' s a Source #

A `Traversal` reading and writing to the last element of a non-empty container.

    >>> [a,b,c]^?!_last
    c

    >>> []^?_last
    Nothing

    >>> [a,b,c] & _last %~ f
    [a,b,f c]

    >>> [1,2]^?_last
    Just 2

    >>> [] & _last .~ 1
    []

    >>> [0] & _last .~ 2
    [2]

    >>> [0,1] & _last .~ 2
    [0,2]

This `Traversal` is not limited to lists, however. We can also work with other containers, such as a `Vector`.

    >>> Vector.fromList "abcde" ^? _last
    Just 'e'

    >>> Vector.empty ^? _last
    Nothing

    >>> (Vector.fromList "abcde" & _last .~ 'Q') == Vector.fromList "abcdQ"
    True

    _last :: Traversal' [a] a
    _last :: Traversal' (Seq a) a
    _last :: Traversal' (Vector a) a

_GWrapped' :: forall s (d :: Meta) (c :: Meta) (s' :: Meta) a. (Generic s, D1 d (C1 c (S1 s' (Rec0 a))) ~ Rep s, Unwrapped s ~ GUnwrapped (Rep s)) => Iso' s (Unwrapped s) Source #

Implement the `_Wrapped` operation for a type using its `Generic` instance.

_Unwrapped' :: Wrapped s => Iso' (Unwrapped s) s Source #

_Wrapped :: Rewrapping s t => Iso s t (Unwrapped s) (Unwrapped t) Source #

Work under a newtype wrapper.

    >>> Const "hello" & _Wrapped %~ Prelude.length & getConst
    5

    _Wrapped   ≡ from _Unwrapped
    _Unwrapped ≡ from _Wrapped

_Unwrapped :: Rewrapping s t => Iso (Unwrapped t) (Unwrapped s) t s Source #

op :: Wrapped s => (Unwrapped s -> s) -> s -> Unwrapped s Source #

Given the constructor for a `Wrapped` type, return a deconstructor that is its inverse.

Assuming the `Wrapped` instance is legal, these laws hold:

    op f . f ≡ id
    f . op f ≡ id

    >>> op Identity (Identity 4)
    4

    >>> op Const (Const "hello")
    "hello"

_Wrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' s (Unwrapped s) Source #

This is a convenient version of `_Wrapped` with an argument that's ignored.

The user supplied function is ignored, merely its type is used.

_Unwrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' (Unwrapped s) s Source #

This is a convenient version of `_Wrapped` with an argument that's ignored.

The user supplied function is ignored, merely its type is used.

_Wrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t) Source #

This is a convenient version of `_Wrapped` with an argument that's ignored.

The user supplied function is ignored, merely its types are used.

_Unwrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso (Unwrapped t) (Unwrapped s) t s Source #

This is a convenient version of `_Unwrapped` with an argument that's ignored.

The user supplied function is ignored, merely its types are used.

deep :: (Conjoined p, Applicative f, Plated s) => Traversing p f s s a b -> Over p f s s a b Source #

Try to apply a traversal to all transitive descendants of a `Plated` container, but do not recurse through matching descendants.

    deep :: Plated s => Fold s a                 -> Fold s a
    deep :: Plated s => IndexedFold s a          -> IndexedFold s a
    deep :: Plated s => Traversal s s a b        -> Traversal s s a b
    deep :: Plated s => IndexedTraversal s s a b -> IndexedTraversal s s a b

rewrite :: Plated a => (a -> Maybe a) -> a -> a Source #

Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result:

    propRewrite r x = all (isNothing . r) (universe (rewrite r x))

Usually `transform` is more appropriate, but `rewrite` can give better compositionality. Given two single transformations `f` and `g`, you can construct `\a -> f a `<|>` g a` which performs both rewrites until a fixed point.

rewriteOf :: ASetter a b a b -> (b -> Maybe a) -> a -> b Source #

Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result:

    propRewriteOf l r x = all (isNothing . r) (universeOf l (rewriteOf l r x))

Usually `transformOf` is more appropriate, but `rewriteOf` can give better compositionality. Given two single transformations `f` and `g`, you can construct `\a -> f a `<|>` g a` which performs both rewrites until a fixed point.

    rewriteOf :: Iso' a a       -> (a -> Maybe a) -> a -> a
    rewriteOf :: Lens' a a      -> (a -> Maybe a) -> a -> a
    rewriteOf :: Traversal' a a -> (a -> Maybe a) -> a -> a
    rewriteOf :: Setter' a a    -> (a -> Maybe a) -> a -> a

rewriteOn :: Plated a => ASetter s t a a -> (a -> Maybe a) -> s -> t Source #

Rewrite recursively over part of a larger structure.

    rewriteOn :: Plated a => Iso' s a       -> (a -> Maybe a) -> s -> s
    rewriteOn :: Plated a => Lens' s a      -> (a -> Maybe a) -> s -> s
    rewriteOn :: Plated a => Traversal' s a -> (a -> Maybe a) -> s -> s
    rewriteOn :: Plated a => ASetter' s a   -> (a -> Maybe a) -> s -> s

rewriteOnOf :: ASetter s t a b -> ASetter a b a b -> (b -> Maybe a) -> s -> t Source #

Rewrite recursively over part of a larger structure using a specified `Setter`.

    rewriteOnOf :: Iso' s a       -> Iso' a a       -> (a -> Maybe a) -> s -> s
    rewriteOnOf :: Lens' s a      -> Lens' a a      -> (a -> Maybe a) -> s -> s
    rewriteOnOf :: Traversal' s a -> Traversal' a a -> (a -> Maybe a) -> s -> s
    rewriteOnOf :: Setter' s a    -> Setter' a a    -> (a -> Maybe a) -> s -> s

rewriteM :: (Monad m, Plated a) => (a -> m (Maybe a)) -> a -> m a Source #

Rewrite by applying a monadic rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOf :: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b Source #

Rewrite by applying a monadic rule everywhere you recursing with a user-specified `Traversal`. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOn :: (Monad m, Plated a) => LensLike (WrappedMonad m) s t a a -> (a -> m (Maybe a)) -> s -> m t Source #

Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified `Traversal`. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOnOf :: Monad m => LensLike (WrappedMonad m) s t a b -> LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> s -> m t Source #

Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified `Traversal`, using a user-specified `Traversal` for recursion. Ensures that the rule cannot be applied anywhere in the result.

universe :: Plated a => a -> [a] Source #

Retrieve all of the transitive descendants of a `Plated` container, including itself.

universeOf :: Getting (Endo [a]) a a -> a -> [a] Source #

Given a `Fold` that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself.

    universeOf :: Fold a a -> a -> [a]

universeOn :: Plated a => Getting (Endo [a]) s a -> s -> [a] Source #

Given a `Fold` that knows how to find `Plated` parts of a container retrieve them and all of their descendants, recursively.

universeOnOf :: Getting (Endo [a]) s a -> Getting (Endo [a]) a a -> s -> [a] Source #

Given a `Fold` that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself that lie in a region indicated by another `Fold`.

    toListOf l ≡ universeOnOf l ignored

cosmos :: Plated a => Fold a a Source #

Fold over all transitive descendants of a `Plated` container, including itself.

cosmosOf :: (Applicative f, Contravariant f) => LensLike' f a a -> LensLike' f a a Source #

Given a `Fold` that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself.

    cosmosOf :: Fold a a -> Fold a a

cosmosOn :: (Applicative f, Contravariant f, Plated a) => LensLike' f s a -> LensLike' f s a Source #

Given a `Fold` that knows how to find `Plated` parts of a container fold them and all of their descendants, recursively.

    cosmosOn :: Plated a => Fold s a -> Fold s a

cosmosOnOf :: (Applicative f, Contravariant f) => LensLike' f s a -> LensLike' f a a -> LensLike' f s a Source #

Given a `Fold` that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself that lie in a region indicated by another `Fold`.

    cosmosOnOf :: Fold s a -> Fold a a -> Fold s a

transformOn :: Plated a => ASetter s t a a -> (a -> a) -> s -> t Source #

Transform every element in the tree in a bottom-up manner over a region indicated by a `Setter`.

    transformOn :: Plated a => Traversal' s a -> (a -> a) -> s -> s
    transformOn :: Plated a => Setter' s a    -> (a -> a) -> s -> s

transformOf :: ASetter a b a b -> (b -> b) -> a -> b Source #

Transform every element by recursively applying a given `Setter` in a bottom-up manner.

    transformOf :: Traversal' a a -> (a -> a) -> a -> a
    transformOf :: Setter' a a    -> (a -> a) -> a -> a

transformOnOf :: ASetter s t a b -> ASetter a b a b -> (b -> b) -> s -> t Source #

Transform every element in a region indicated by a `Setter` by recursively applying another `Setter` in a bottom-up manner.

    transformOnOf :: Setter' s a -> Traversal' a a -> (a -> a) -> s -> s
    transformOnOf :: Setter' s a -> Setter' a a    -> (a -> a) -> s -> s

transformM :: (Monad m, Plated a) => (a -> m a) -> a -> m a Source #

Transform every element in the tree, in a bottom-up manner, monadically.

transformMOn :: (Monad m, Plated a) => LensLike (WrappedMonad m) s t a a -> (a -> m a) -> s -> m t Source #

Transform every element in the tree in a region indicated by a supplied `Traversal`, in a bottom-up manner, monadically.

    transformMOn :: (Monad m, Plated a) => Traversal' s a -> (a -> m a) -> s -> m s

transformMOf :: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b Source #

Transform every element in a tree using a user supplied `Traversal` in a bottom-up manner with a monadic effect.

    transformMOf :: Monad m => Traversal' a a -> (a -> m a) -> a -> m a

transformMOnOf :: Monad m => LensLike (WrappedMonad m) s t a b -> LensLike (WrappedMonad m) a b a b -> (b -> m b) -> s -> m t Source #

Transform every element in a tree that lies in a region indicated by a supplied `Traversal`, walking with a user supplied `Traversal` in a bottom-up manner with a monadic effect.

    transformMOnOf :: Monad m => Traversal' s a -> Traversal' a a -> (a -> m a) -> s -> m s

contexts :: Plated a => a -> [Context a a a] Source #

Return a list of all of the editable contexts for every location in the structure, recursively.

    propUniverse x = universe x == map pos (contexts x)
    propId x = all (== x) [extract w | w <- contexts x]

    contexts ≡ contextsOf plate

contextsOn :: Plated a => ATraversal s t a a -> s -> [Context a a t] Source #

Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied `Traversal`, recursively using `plate`.

    contextsOn b ≡ contextsOnOf b plate

    contextsOn :: Plated a => Traversal' s a -> s -> [Context a a s]

contextsOnOf :: ATraversal s t a a -> ATraversal' a a -> s -> [Context a a t] Source #

Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied `Traversal`, recursively using another user-supplied `Traversal` to walk each layer.

    contextsOnOf :: Traversal' s a -> Traversal' a a -> s -> [Context a a s]

holes :: Plated a => a -> [Pretext (->) a a a] Source #

The one-level version of `context`. This extracts a list of the immediate children as editable contexts.

Given a context you can use `pos` to see the values, `peek` at what the structure would be like with an edited result, or simply `extract` the original structure.

    propChildren x = children l x == map pos (holes l x)
    propId x = all (== x) [extract w | w <- holes l x]

    holes = holesOf plate

holesOn :: Conjoined p => Over p (Bazaar p a a) s t a a -> s -> [Pretext p a a t] Source #

An alias for `holesOf`, provided for consistency with the other combinators.

    holesOn ≡ holesOf

    holesOn :: Iso' s a                -> s -> [Pretext (->) a a s]
    holesOn :: Lens' s a               -> s -> [Pretext (->) a a s]
    holesOn :: Traversal' s a          -> s -> [Pretext (->) a a s]
    holesOn :: IndexedLens' i s a      -> s -> [Pretext (Indexed i) a a s]
    holesOn :: IndexedTraversal' i s a -> s -> [Pretext (Indexed i) a a s]

holesOnOf :: Conjoined p => LensLike (Bazaar p r r) s t a b -> Over p (Bazaar p r r) a b r r -> s -> [Pretext p r r t] Source #

Extract one level of `holes` from a container in a region specified by one `Traversal`, using another.

    holesOnOf b l ≡ holesOf (b . l)

    holesOnOf :: Iso' s a       -> Iso' a a                -> s -> [Pretext (->) a a s]
    holesOnOf :: Lens' s a      -> Lens' a a               -> s -> [Pretext (->) a a s]
    holesOnOf :: Traversal' s a -> Traversal' a a          -> s -> [Pretext (->) a a s]
    holesOnOf :: Lens' s a      -> IndexedLens' i a a      -> s -> [Pretext (Indexed i) a a s]
    holesOnOf :: Traversal' s a -> IndexedTraversal' i a a -> s -> [Pretext (Indexed i) a a s]

paraOf :: Getting (Endo [a]) a a -> (a -> [r] -> r) -> a -> r Source #

Perform a fold-like computation on each value, technically a paramorphism.

    paraOf :: Fold a a -> (a -> [r] -> r) -> a -> r

para :: Plated a => (a -> [r] -> r) -> a -> r Source #

Perform a fold-like computation on each value, technically a paramorphism.

    para ≡ paraOf plate

composOpFold :: Plated a => b -> (b -> b -> b) -> (a -> b) -> a -> b Source #

Fold the immediate children of a `Plated` container.

    composOpFold z c f = foldrOf plate (c . f) z

parts :: Plated a => Lens' a [a] Source #

The original `uniplate` combinator, implemented in terms of `Plated` as a `Lens`.

    parts ≡ partsOf plate

The resulting `Lens` is safer to use as it ignores 'over-application' and deals gracefully with under-application, but it is only a proper `Lens` if you don't change the list `length`!

gplate :: (Generic a, GPlated a (Rep a)) => Traversal' a a Source #

Implement `plate` operation for a type using its `Generic` instance.

Note: the behavior may be different than with `uniplate` in some special cases. `gplate` doesn't look through other types in a group of mutually recursive types.

For example consider mutually recursive even and odd natural numbers:

    >>> data Even = Z | E Odd deriving (Show, Generic, Data); data Odd = O Even deriving (Show, Generic, Data)

Then `uniplate`, which is based on `Data`, finds all even numbers less or equal than four:

    >>> import Data.Data.Lens (uniplate)
    >>> universeOf uniplate (E (O (E (O Z))))
    [E (O (E (O Z))),E (O Z),Z]

but `gplate` doesn't see through `Odd`.

    >>> universeOf gplate (E (O (E (O Z))))
    [E (O (E (O Z)))]

If using `Data` is not an option, you can still write the traversal manually. It is sometimes useful to use helper traversals

    >>> :{
    let oddeven :: Traversal' Odd Even
        oddeven f (O n) = O <$> f n
        evenplate :: Traversal' Even Even
        evenplate f Z     = pure Z
        evenplate f (E n) = E <$> oddeven f n
    :}

    >>> universeOf evenplate (E (O (E (O Z))))
    [E (O (E (O Z))),E (O Z),Z]

gplate1 :: forall {k} (f :: k -> Type) (a :: k). (Generic1 f, GPlated1 f (Rep1 f)) => Traversal' (f a) (f a) Source #

Implement `plate` operation for a type using its `Generic1` instance.

icontains :: Contains m => Index m -> IndexedLens' (Index m) m Bool Source #

An indexed version of `contains`.

    >>> IntSet.fromList [1,2,3,4] ^@. icontains 3
    (3,True)

    >>> IntSet.fromList [1,2,3,4] ^@. icontains 5
    (5,False)

    >>> IntSet.fromList [1,2,3,4] & icontains 3 %@~ \i x -> if odd i then not x else x
    fromList [1,2,4]

    >>> IntSet.fromList [1,2,3,4] & icontains 3 %@~ \i x -> if even i then not x else x
    fromList [1,2,3,4]

iix :: Ixed m => Index m -> IndexedTraversal' (Index m) m (IxValue m) Source #

An indexed version of `ix`.

    >>> Seq.fromList [a,b,c,d] & iix 2 %@~ f'
    fromList [a,b,f' 2 c,d]

    >>> Seq.fromList [a,b,c,d] & iix 2 .@~ h
    fromList [a,b,h 2,d]

    >>> Seq.fromList [a,b,c,d] ^@? iix 2
    Just (2,c)

    >>> Seq.fromList [] ^@? iix 2
    Nothing

ixAt :: At m => Index m -> Traversal' m (IxValue m) Source #

A definition of `ix` for types with an `At` instance. This is the default if you don't specify a definition for `ix`.

sans :: At m => Index m -> m -> m Source #

Delete the value associated with a key in a `Map`-like container

    sans k = at k .~ Nothing

iat :: At m => Index m -> IndexedLens' (Index m) m (Maybe (IxValue m)) Source #

An indexed version of `at`.

    >>> Map.fromList [(1,"world")] ^@. iat 1
    (1,Just "world")

    >>> iat 1 %@~ (\i x -> if odd i then Just "hello" else Nothing) $ Map.empty
    fromList [(1,"hello")]

    >>> iat 2 %@~ (\i x -> if odd i then Just "hello" else Nothing) $ Map.empty
    fromList []

makePrisms Source #

Arguments

:: Name | Type constructor name
-> DecsQ |

Generate a `Prism` for each constructor of a data type. Isos generated when possible. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

    data FooBarBaz a
      = Foo Int
      | Bar a
      | Baz Int Char
    makePrisms ''FooBarBaz

will create

    _Foo :: Prism' (FooBarBaz a) Int
    _Bar :: Prism (FooBarBaz a) (FooBarBaz b) a b
    _Baz :: Prism' (FooBarBaz a) (Int, Char)

makeClassyPrisms Source #

Arguments

:: Name | Type constructor name
-> DecsQ |

Generate a `Prism` for each constructor of a data type and combine them into a single class. No Isos are created. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

    data FooBarBaz a
      = Foo Int
      | Bar a
      | Baz Int Char
    makeClassyPrisms ''FooBarBaz

will create

    class AsFooBarBaz s a | s -> a where
      _FooBarBaz :: Prism' s (FooBarBaz a)
      _Foo :: Prism' s Int
      _Bar :: Prism' s a
      _Baz :: Prism' s (Int,Char)

      _Foo = _FooBarBaz . _Foo
      _Bar = _FooBarBaz . _Bar
      _Baz = _FooBarBaz . _Baz

    instance AsFooBarBaz (FooBarBaz a) a

Generate an As class of prisms. Names are selected by prefixing the constructor name with an underscore. Constructors with multiple fields will construct Prisms to tuples of those fields.

In the event that the name of a data type is also the name of one of its constructors, the name of the `Prism` generated for the data type will be prefixed with an extra `_` (if the data type name is prefix) or `.` (if the name is infix) to disambiguate it from the `Prism` for the corresponding constructor. For example, this code:

    data Quux = Quux Int | Fred Bool
    makeClassyPrisms ''Quux

will create:

    class AsQuux s where
      __Quux :: Prism' s Quux -- Data type prism
      _Quux :: Prism' s Int   -- Constructor prism
      _Fred :: Prism' s Bool

      _Quux = __Quux . _Quux
      _Fred = __Quux . _Fred

    instance AsQuux Quux

simpleLenses :: Lens' LensRules Bool Source #

Generate "simple" optics even when type-changing optics are possible. (e.g. `Lens'` instead of `Lens`)

generateSignatures :: Lens' LensRules Bool Source #

Indicate whether or not to supply the signatures for the generated lenses.

Disabling this can be useful if you want to provide a more restricted type signature or if you want to supply hand-written haddocks.

generateUpdateableOptics :: Lens' LensRules Bool Source #

Generate "updateable" optics when `True`. When `False`, `Fold`s will be generated instead of `Traversal`s and `Getter`s will be generated instead of `Lens`es. This mode is intended to be used for types with invariants which must be maintained by "smart" constructors.

generateLazyPatterns :: Lens' LensRules Bool Source #

Generate optics using lazy pattern matches. This can allow fields of an undefined value to be initialized with lenses:

    data Foo = Foo {_x :: Int, _y :: Bool}
      deriving Show

    makeLensesWith (lensRules & generateLazyPatterns .~ True) ''Foo

    > undefined & x .~ 8 & y .~ True
    Foo {_x = 8, _y = True}

The downside of this flag is that it can lead to space-leaks and code-size/compile-time increases when generated for large records. By default this flag is turned off, and strict optics are generated.

When using lazy optics the strict optic can be recovered by composing with `$!`:

    strictOptic = ($!) . lazyOptic

generateRecordSyntax :: Lens' LensRules Bool Source #

createClass :: Lens' LensRules Bool Source #

Create the class if the constructor is `Simple` and the `lensClass` rule matches.

lensField :: Lens' LensRules FieldNamer Source #

`Lens'` to access the convention for naming fields in our `LensRules`.

lensClass :: Lens' LensRules ClassyNamer Source #

`Lens'` to access the option for naming "classy" lenses.

lensRules :: LensRules Source #

Rules for making fairly simple partial lenses, ignoring the special cases for isomorphisms and traversals, and not making any classes. It uses `underscoreNoPrefixNamer`.

underscoreNoPrefixNamer :: FieldNamer Source #

A `FieldNamer` that strips the _ off of the field name, lowercases the name, and skips the field if it doesn't start with an '_'.

lensRulesFor Source #

Arguments

:: [(String, String)]

(Field Name, Definition Name)

-> LensRules |

Construct a `LensRules` value for generating top-level definitions using the given map from field names to definition names.

lookingupNamer :: [(String, String)] -> FieldNamer Source #

Create a `FieldNamer` from explicit pairings of `(fieldName, lensName)`.

mappingNamer Source #

Arguments

:: (String -> [String]) | A function that maps a `fieldName` to `lensName`s.
-> FieldNamer |

Create a `FieldNamer` from a mapping function. If the function returns `[]`, it creates no lens for the field.

classyRules :: LensRules Source #

Rules for making lenses and traversals that precompose another `Lens`.

classyRules_ :: LensRules Source #

A `LensRules` used by `makeClassy_`.

makeLenses :: Name -> DecsQ Source #

Build lenses (and traversals) with a sensible default configuration.

e.g.

    data FooBar
      = Foo { _x, _y :: Int }
      | Bar { _x :: Int }
    makeLenses ''FooBar

will create

    x :: Lens' FooBar Int
    x f (Foo a b) = (\a' -> Foo a' b) <$> f a
    x f (Bar a)   = Bar <$> f a
    y :: Traversal' FooBar Int
    y f (Foo a b) = (\b' -> Foo a  b') <$> f b
    y _ c@(Bar _) = pure c

    makeLenses = makeLensesWith lensRules

makeClassy :: Name -> DecsQ Source #

Make lenses and traversals for a type, and create a class when the type has no arguments.

e.g.

    data Foo = Foo { _fooX, _fooY :: Int }
    makeClassy ''Foo

will create

    class HasFoo t where
      foo :: Lens' t Foo
      fooX :: Lens' t Int
      fooX = foo . go where go f (Foo x y) = (\x' -> Foo x' y) <$> f x
      fooY :: Lens' t Int
      fooY = foo . go where go f (Foo x y) = (\y' -> Foo x y') <$> f y
    instance HasFoo Foo where
      foo = id

    makeClassy = makeLensesWith classyRules

makeClassy_ :: Name -> DecsQ Source #

Make lenses and traversals for a type, and create a class when the type has no arguments. Works the same as `makeClassy` except that (a) it expects that record field names do not begin with an underscore, (b) all record fields are made into lenses, and (c) the resulting lens is prefixed with an underscore.

makeLensesFor :: [(String, String)] -> Name -> DecsQ Source #

Derive lenses and traversals, specifying explicit pairings of `(fieldName, lensName)`.

If you map multiple names to the same label, and it is present in the same constructor then this will generate a `Traversal`.

e.g.

    makeLensesFor [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo
    makeLensesFor [("_barX", "bar"), ("_barY", "bar")] ''Bar

makeClassyFor :: String -> String -> [(String, String)] -> Name -> DecsQ Source #

Derive lenses and traversals, using a named wrapper class, and specifying explicit pairings of `(fieldName, traversalName)`.

Example usage:

    makeClassyFor "HasFoo" "foo" [("_foo", "fooLens"), ("bar", "lbar")] ''Foo

makeLensesWith :: LensRules -> Name -> DecsQ Source #

Build lenses with a custom configuration.

declareLenses :: DecsQ -> DecsQ Source #

Make lenses for all records in the given declaration quote. All record syntax in the input will be stripped off.

e.g.

    declareLenses [d|
      data Foo = Foo { fooX, fooY :: Int }
        deriving Show
      |]

will create

    data Foo = Foo Int Int deriving Show
    fooX, fooY :: Lens' Foo Int

declareLensesFor :: [(String, String)] -> DecsQ -> DecsQ Source #

Similar to `makeLensesFor`, but takes a declaration quote.

declareClassy :: DecsQ -> DecsQ Source #

For each record in the declaration quote, make lenses and traversals for it, and create a class when the type has no arguments. All record syntax in the input will be stripped off.

e.g.

    declareClassy [d|
      data Foo = Foo { fooX, fooY :: Int }
        deriving Show
      |]

will create

    data Foo = Foo Int Int deriving Show
    class HasFoo t where
      foo :: Lens' t Foo
    instance HasFoo Foo where foo = id
    fooX, fooY :: HasFoo t => Lens' t Int

declareClassyFor :: [(String, (String, String))] -> [(String, String)] -> DecsQ -> DecsQ Source #

Similar to `makeClassyFor`, but takes a declaration quote.

declarePrisms :: DecsQ -> DecsQ Source #

Generate a `Prism` for each constructor of each data type.

e.g.

    declarePrisms [d|
      data Exp = Lit Int | Var String | Lambda{ bound::String, body::Exp }
      |]

will create

    data Exp = Lit Int | Var String | Lambda { bound::String, body::Exp }
    _Lit :: Prism' Exp Int
    _Var :: Prism' Exp String
    _Lambda :: Prism' Exp (String, Exp)

declareWrapped :: DecsQ -> DecsQ Source #

Build `Wrapped` instance for each newtype.

declareFields :: DecsQ -> DecsQ Source #

     declareFields = declareLensesWith defaultFieldRules

declareLensesWith :: LensRules -> DecsQ -> DecsQ Source #

Declare lenses for each records in the given declarations, using the specified `LensRules`. Any record syntax in the input will be stripped off.

makeWrapped :: Name -> DecsQ Source #

Build `Wrapped` instance for a given newtype

underscoreFields :: LensRules Source #

Field rules for fields in the form `_prefix_fieldname`

underscoreNamer :: FieldNamer Source #

A `FieldNamer` for `underscoreFields`.

camelCaseFields :: LensRules Source #

Field rules for fields in the form `prefixFieldname or _prefixFieldname` If you want all fields to be lensed, then there is no reason to use an `_` before the prefix. If any of the record fields leads with an `_` then it is assume a field without an `_` should not have a lens created.

Note: The `prefix` must be the same as the typename (with the first letter lowercased). This is a change from lens versions before lens 4.5. If you want the old behaviour, use `makeLensesWith` `abbreviatedFields`

camelCaseNamer :: FieldNamer Source #

A `FieldNamer` for `camelCaseFields`.

classUnderscoreNoPrefixFields :: LensRules Source #

Field rules for fields in the form `_fieldname` (the leading underscore is mandatory).

Note: The primary difference to `camelCaseFields` is that for `classUnderscoreNoPrefixFields` the field names are not expected to be prefixed with the type name. This might be the desired behaviour when the `DuplicateRecordFields` extension is enabled.

classUnderscoreNoPrefixNamer :: FieldNamer Source #

A `FieldNamer` for `classUnderscoreNoPrefixFields`.

abbreviatedFields :: LensRules Source #

Field rules fields in the form `prefixFieldname or _prefixFieldname` If you want all fields to be lensed, then there is no reason to use an `_` before the prefix. If any of the record fields leads with an `_` then it is assume a field without an `_` should not have a lens created.

Note that `prefix` may be any string of characters that are not uppercase letters. (In particular, it may be arbitrary string of lowercase letters and numbers) This is the behavior that `defaultFieldRules` had in lens 4.4 and earlier.

abbreviatedNamer :: FieldNamer Source #

A `FieldNamer` for `abbreviatedFields`.

makeFields :: Name -> DecsQ Source #

Generate overloaded field accessors.

e.g

    data Foo a = Foo { _fooX :: Int, _fooY :: a }
    newtype Bar = Bar { _barX :: Char }
    makeFields ''Foo
    makeFields ''Bar

will create

    _fooXLens :: Lens' (Foo a) Int
    _fooYLens :: Lens (Foo a) (Foo b) a b
    class HasX s a | s -> a where
      x :: Lens' s a
    instance HasX (Foo a) Int where
      x = _fooXLens
    class HasY s a | s -> a where
      y :: Lens' s a
    instance HasY (Foo a) a where
      y = _fooYLens
    _barXLens :: Iso' Bar Char
    instance HasX Bar Char where
      x = _barXLens

For details, see `camelCaseFields`.

    makeFields = makeLensesWith defaultFieldRules

makeFieldsNoPrefix :: Name -> DecsQ Source #

Generate overloaded field accessors based on field names which are only prefixed with an underscore (e.g. `_name`), not additionally with the type name (e.g. `_fooName`).

This might be the desired behaviour in case the `DuplicateRecordFields` language extension is used in order to get rid of the necessity to prefix each field name with the type name.

As an example:

    data Foo a  = Foo { _x :: Int, _y :: a }
    newtype Bar = Bar { _x :: Char }
    makeFieldsNoPrefix ''Foo
    makeFieldsNoPrefix ''Bar

will create classes

    class HasX s a | s -> a where
      x :: Lens' s a
    class HasY s a | s -> a where
      y :: Lens' s a

together with instances

    instance HasX (Foo a) Int
    instance HasY (Foo a) a where
    instance HasX Bar Char where

For details, see `classUnderscoreNoPrefixFields`.

    makeFieldsNoPrefix = makeLensesWith classUnderscoreNoPrefixFields

defaultFieldRules :: LensRules Source #

class Functor f => Applicative (f :: Type -> Type) where Source #

A functor with application, providing operations to

- embed pure expressions (`pure`), and
- sequence computations and combine their results (`<*>` and `liftA2`).

A minimal complete definition must include implementations of `pure` and of either `<*>` or `liftA2`. If it defines both, then they must behave the same as their default definitions:

    (<*>) = liftA2 id

    liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

Identity

      pure id <*> v = v

Composition

      pure (.) <*> u <*> v <*> w = u <*> (v <*> w)

Homomorphism

      pure f <*> pure x = pure (f x)

Interchange

      u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

-     u *> v = (id <$ u) <*> v

-     u <* v = liftA2 const u v

As a consequence of these laws, the `Functor` instance for `f` will satisfy

-     fmap f x = pure f <*> x

It may be useful to note that supposing

    forall x y. p (q x y) = f x . g y

it follows from the above that

    liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If `f` is also a `Monad`, it should satisfy

-     pure = return

-     m1 <*> m2 = m1 >>= (\x1 -> m2 >>= (\x2 -> return (x1 x2)))

-     (*>) = (>>)

(which implies that `pure` and `<*>` satisfy the applicative functor laws).

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a Source #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 Source #

Sequential application.

A few functors support an implementation of `<*>` that is more efficient than the default one.

#### Example

Expand

Used in combination with `(`<$>`)`, `(`<*>`)` can be used to build a record.

    >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}

    >>> produceFoo :: Applicative f => f Foo

    >>> produceBar :: Applicative f => f Bar
    >>> produceBaz :: Applicative f => f Baz

    >>> mkState :: Applicative f => f MyState
    >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz

liftA2 :: (a -> b -> c) -> f a -> f b -> f c Source #

Lift a binary function to actions.

Some functors support an implementation of `liftA2` that is more efficient than the default one. In particular, if `fmap` is an expensive operation, it is likely better to use `liftA2` than to `fmap` over the structure and then use `<*>`.

This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of `<*>` and `fmap`.

#### Example

Expand

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)

(*>) :: f a -> f b -> f b infixl 4 Source #

Sequence actions, discarding the value of the first argument.

#### Examples

Expand

If used in conjunction with the Applicative instance for `Maybe`, you can chain Maybe computations, with a possible "early return" in case of `Nothing`.

    >>> Just 2 *> Just 3
    Just 3

    >>> Nothing *> Just 3
    Nothing

Of course a more interesting use case would be to have effectful computations instead of just returning pure values.

    >>> import Data.Char
    >>> import Text.ParserCombinators.ReadP
    >>> let p = string "my name is " *> munch1 isAlpha <* eof
    >>> readP_to_S p "my name is Simon"
    [("Simon","")]

(<*) :: f a -> f b -> f a infixl 4 Source #

Sequence actions, discarding the value of the second argument.

#### Instances

Instances details

Applicative Active |
Instance details Defined in Data.Active Methods pure :: a -> Active a Source # (<*>) :: Active (a -> b) -> Active a -> Active b Source # liftA2 :: (a -> b -> c) -> Active a -> Active b -> Active c Source # (*>) :: Active a -> Active b -> Active b Source # (<*) :: Active a -> Active b -> Active a Source #
Applicative Duration |
Instance details Defined in Data.Active Methods pure :: a -> Duration a Source # (<*>) :: Duration (a -> b) -> Duration a -> Duration b Source # liftA2 :: (a -> b -> c) -> Duration a -> Duration b -> Duration c Source # (*>) :: Duration a -> Duration b -> Duration b Source # (<*) :: Duration a -> Duration b -> Duration a Source #

Applicative ZipList

    f <$> ZipList xs1 <*> ... <*> ZipList xsN
        = ZipList (zipWithN f xs1 ... xsN)

where `zipWithN` refers to the `zipWith` function of the appropriate arity (`zipWith`, `zipWith3`, `zipWith4`, ...). For example:

    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: base-2.1

Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a Source # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source # (*>) :: ZipList a -> ZipList b -> ZipList b Source # (<*) :: ZipList a -> ZipList b -> ZipList a Source #
Applicative Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods pure :: a -> Complex a Source # (<*>) :: Complex (a -> b) -> Complex a -> Complex b Source # liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c Source # (*>) :: Complex a -> Complex b -> Complex b Source # (<*) :: Complex a -> Complex b -> Complex a Source #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a Source # (<*>) :: Identity (a -> b) -> Identity a -> Identity b Source # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source # (*>) :: Identity a -> Identity b -> Identity b Source # (<*) :: Identity a -> Identity b -> Identity a Source #
Applicative First | Since: base-4.8.0.0
Instance details Defined in Data.Monoid Methods pure :: a -> First a Source # (<*>) :: First (a -> b) -> First a -> First b Source # liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source # (*>) :: First a -> First b -> First b Source # (<*) :: First a -> First b -> First a Source #
Applicative Last | Since: base-4.8.0.0
Instance details Defined in Data.Monoid Methods pure :: a -> Last a Source # (<*>) :: Last (a -> b) -> Last a -> Last b Source # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source # (*>) :: Last a -> Last b -> Last b Source # (<*) :: Last a -> Last b -> Last a Source #
Applicative Down | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods pure :: a -> Down a Source # (<*>) :: Down (a -> b) -> Down a -> Down b Source # liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source # (*>) :: Down a -> Down b -> Down b Source # (<*) :: Down a -> Down b -> Down a Source #
Applicative First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a Source # (<*>) :: First (a -> b) -> First a -> First b Source # liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source # (*>) :: First a -> First b -> First b Source # (<*) :: First a -> First b -> First a Source #
Applicative Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a Source # (<*>) :: Last (a -> b) -> Last a -> Last b Source # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source # (*>) :: Last a -> Last b -> Last b Source # (<*) :: Last a -> Last b -> Last a Source #
Applicative Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a Source # (<*>) :: Max (a -> b) -> Max a -> Max b Source # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c Source # (*>) :: Max a -> Max b -> Max b Source # (<*) :: Max a -> Max b -> Max a Source #
Applicative Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a Source # (<*>) :: Min (a -> b) -> Min a -> Min b Source # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c Source # (*>) :: Min a -> Min b -> Min b Source # (<*) :: Min a -> Min b -> Min a Source #
Applicative Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Dual a Source # (<*>) :: Dual (a -> b) -> Dual a -> Dual b Source # liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c Source # (*>) :: Dual a -> Dual b -> Dual b Source # (<*) :: Dual a -> Dual b -> Dual a Source #
Applicative Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Product a Source # (<*>) :: Product (a -> b) -> Product a -> Product b Source # liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c Source # (*>) :: Product a -> Product b -> Product b Source # (<*) :: Product a -> Product b -> Product a Source #
Applicative Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Sum a Source # (<*>) :: Sum (a -> b) -> Sum a -> Sum b Source # liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c Source # (*>) :: Sum a -> Sum b -> Sum b Source # (<*) :: Sum a -> Sum b -> Sum a Source #
Applicative Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Par1 a Source # (<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b Source # liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c Source # (*>) :: Par1 a -> Par1 b -> Par1 b Source # (<*) :: Par1 a -> Par1 b -> Par1 a Source #
Applicative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> P a Source # (<*>) :: P (a -> b) -> P a -> P b Source # liftA2 :: (a -> b -> c) -> P a -> P b -> P c Source # (*>) :: P a -> P b -> P b Source # (<*) :: P a -> P b -> P a Source #
Applicative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a Source # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b Source # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c Source # (*>) :: ReadP a -> ReadP b -> ReadP b Source # (<*) :: ReadP a -> ReadP b -> ReadP a Source #
Applicative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a Source # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b Source # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c Source # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b Source # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a Source #
Applicative Get |
Instance details Defined in Data.Serialize.Get Methods pure :: a -> Get a Source # (<*>) :: Get (a -> b) -> Get a -> Get b Source # liftA2 :: (a -> b -> c) -> Get a -> Get b -> Get c Source # (*>) :: Get a -> Get b -> Get b Source # (<*) :: Get a -> Get b -> Get a Source #
Applicative PutM |
Instance details Defined in Data.Serialize.Put Methods pure :: a -> PutM a Source # (<*>) :: PutM (a -> b) -> PutM a -> PutM b Source # liftA2 :: (a -> b -> c) -> PutM a -> PutM b -> PutM c Source # (*>) :: PutM a -> PutM b -> PutM b Source # (<*) :: PutM a -> PutM b -> PutM a Source #
Applicative RGB |
Instance details Defined in Data.Colour.RGB Methods pure :: a -> RGB a Source # (<*>) :: RGB (a -> b) -> RGB a -> RGB b Source # liftA2 :: (a -> b -> c) -> RGB a -> RGB b -> RGB c Source # (*>) :: RGB a -> RGB b -> RGB b Source # (<*) :: RGB a -> RGB b -> RGB a Source #
Applicative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods pure :: a -> Seq a Source # (<*>) :: Seq (a -> b) -> Seq a -> Seq b Source # liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c Source # (*>) :: Seq a -> Seq b -> Seq b Source # (<*) :: Seq a -> Seq b -> Seq a Source #
Applicative Tree |
Instance details Defined in Data.Tree Methods pure :: a -> Tree a Source # (<*>) :: Tree (a -> b) -> Tree a -> Tree b Source # liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c Source # (*>) :: Tree a -> Tree b -> Tree b Source # (<*) :: Tree a -> Tree b -> Tree a Source #
Applicative Angle Source # |
Instance details Defined in Diagrams.Angle Methods pure :: a -> Angle a Source # (<*>) :: Angle (a -> b) -> Angle a -> Angle b Source # liftA2 :: (a -> b -> c) -> Angle a -> Angle b -> Angle c Source # (*>) :: Angle a -> Angle b -> Angle b Source # (<*) :: Angle a -> Angle b -> Angle a Source #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a Source # (<*>) :: IO (a -> b) -> IO a -> IO b Source # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source # (*>) :: IO a -> IO b -> IO b Source # (<*) :: IO a -> IO b -> IO a Source #
Applicative Interval |
Instance details Defined in Numeric.Interval.Kaucher Methods pure :: a -> Interval a Source # (<*>) :: Interval (a -> b) -> Interval a -> Interval b Source # liftA2 :: (a -> b -> c) -> Interval a -> Interval b -> Interval c Source # (*>) :: Interval a -> Interval b -> Interval b Source # (<*) :: Interval a -> Interval b -> Interval a Source #
Applicative Plucker |
Instance details Defined in Linear.Plucker Methods pure :: a -> Plucker a Source # (<*>) :: Plucker (a -> b) -> Plucker a -> Plucker b Source # liftA2 :: (a -> b -> c) -> Plucker a -> Plucker b -> Plucker c Source # (*>) :: Plucker a -> Plucker b -> Plucker b Source # (<*) :: Plucker a -> Plucker b -> Plucker a Source #
Applicative Quaternion |
Instance details Defined in Linear.Quaternion Methods pure :: a -> Quaternion a Source # (<*>) :: Quaternion (a -> b) -> Quaternion a -> Quaternion b Source # liftA2 :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c Source # (*>) :: Quaternion a -> Quaternion b -> Quaternion b Source # (<*) :: Quaternion a -> Quaternion b -> Quaternion a Source #
Applicative V0 |
Instance details Defined in Linear.V0 Methods pure :: a -> V0 a Source # (<*>) :: V0 (a -> b) -> V0 a -> V0 b Source # liftA2 :: (a -> b -> c) -> V0 a -> V0 b -> V0 c Source # (*>) :: V0 a -> V0 b -> V0 b Source # (<*) :: V0 a -> V0 b -> V0 a Source #
Applicative V1 |
Instance details Defined in Linear.V1 Methods pure :: a -> V1 a Source # (<*>) :: V1 (a -> b) -> V1 a -> V1 b Source # liftA2 :: (a -> b -> c) -> V1 a -> V1 b -> V1 c Source # (*>) :: V1 a -> V1 b -> V1 b Source # (<*) :: V1 a -> V1 b -> V1 a Source #
Applicative V2 |
Instance details Defined in Linear.V2 Methods pure :: a -> V2 a Source # (<*>) :: V2 (a -> b) -> V2 a -> V2 b Source # liftA2 :: (a -> b -> c) -> V2 a -> V2 b -> V2 c Source # (*>) :: V2 a -> V2 b -> V2 b Source # (<*) :: V2 a -> V2 b -> V2 a Source #
Applicative V3 |
Instance details Defined in Linear.V3 Methods pure :: a -> V3 a Source # (<*>) :: V3 (a -> b) -> V3 a -> V3 b Source # liftA2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c Source # (*>) :: V3 a -> V3 b -> V3 b Source # (<*) :: V3 a -> V3 b -> V3 a Source #
Applicative V4 |
Instance details Defined in Linear.V4 Methods pure :: a -> V4 a Source # (<*>) :: V4 (a -> b) -> V4 a -> V4 b Source # liftA2 :: (a -> b -> c) -> V4 a -> V4 b -> V4 c Source # (*>) :: V4 a -> V4 b -> V4 b Source # (<*) :: V4 a -> V4 b -> V4 a Source #
Applicative Parser |
Instance details Defined in Options.Applicative.Types Methods pure :: a -> Parser a Source # (<*>) :: Parser (a -> b) -> Parser a -> Parser b Source # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source # (*>) :: Parser a -> Parser b -> Parser b Source # (<*) :: Parser a -> Parser b -> Parser a Source #
Applicative ParserM |
Instance details Defined in Options.Applicative.Types Methods pure :: a -> ParserM a Source # (<*>) :: ParserM (a -> b) -> ParserM a -> ParserM b Source # liftA2 :: (a -> b -> c) -> ParserM a -> ParserM b -> ParserM c Source # (*>) :: ParserM a -> ParserM b -> ParserM b Source # (<*) :: ParserM a -> ParserM b -> ParserM a Source #
Applicative ParserResult |
Instance details Defined in Options.Applicative.Types Methods pure :: a -> ParserResult a Source # (<*>) :: ParserResult (a -> b) -> ParserResult a -> ParserResult b Source # liftA2 :: (a -> b -> c) -> ParserResult a -> ParserResult b -> ParserResult c Source # (*>) :: ParserResult a -> ParserResult b -> ParserResult b Source # (<*) :: ParserResult a -> ParserResult b -> ParserResult a Source #
Applicative ReadM |
Instance details Defined in Options.Applicative.Types Methods pure :: a -> ReadM a Source # (<*>) :: ReadM (a -> b) -> ReadM a -> ReadM b Source # liftA2 :: (a -> b -> c) -> ReadM a -> ReadM b -> ReadM c Source # (*>) :: ReadM a -> ReadM b -> ReadM b Source # (<*) :: ReadM a -> ReadM b -> ReadM a Source #
Applicative Array |
Instance details Defined in Data.Primitive.Array Methods pure :: a -> Array a Source # (<*>) :: Array (a -> b) -> Array a -> Array b Source # liftA2 :: (a -> b -> c) -> Array a -> Array b -> Array c Source # (*>) :: Array a -> Array b -> Array b Source # (<*) :: Array a -> Array b -> Array a Source #
Applicative SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods pure :: a -> SmallArray a Source # (<*>) :: SmallArray (a -> b) -> SmallArray a -> SmallArray b Source # liftA2 :: (a -> b -> c) -> SmallArray a -> SmallArray b -> SmallArray c Source # (*>) :: SmallArray a -> SmallArray b -> SmallArray b Source # (<*) :: SmallArray a -> SmallArray b -> SmallArray a Source #
Applicative Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods pure :: a -> Q a Source # (<*>) :: Q (a -> b) -> Q a -> Q b Source # liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c Source # (*>) :: Q a -> Q b -> Q b Source # (<*) :: Q a -> Q b -> Q a Source #
Applicative Vector |
Instance details Defined in Data.Vector Methods pure :: a -> Vector a Source # (<*>) :: Vector (a -> b) -> Vector a -> Vector b Source # liftA2 :: (a -> b -> c) -> Vector a -> Vector b -> Vector c Source # (*>) :: Vector a -> Vector b -> Vector b Source # (<*) :: Vector a -> Vector b -> Vector a Source #
Applicative Stream |
Instance details Defined in Codec.Compression.Zlib.Stream Methods pure :: a -> Stream a Source # (<*>) :: Stream (a -> b) -> Stream a -> Stream b Source # liftA2 :: (a -> b -> c) -> Stream a -> Stream b -> Stream c Source # (*>) :: Stream a -> Stream b -> Stream b Source # (<*) :: Stream a -> Stream b -> Stream a Source #
Applicative NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods pure :: a -> NonEmpty a Source # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b Source # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c Source # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a Source #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a Source # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source # (*>) :: Maybe a -> Maybe b -> Maybe b Source # (<*) :: Maybe a -> Maybe b -> Maybe a Source #
Applicative Solo | Since: base-4.15
Instance details Defined in GHC.Base Methods pure :: a -> Solo a Source # (<*>) :: Solo (a -> b) -> Solo a -> Solo b Source # liftA2 :: (a -> b -> c) -> Solo a -> Solo b -> Solo c Source # (*>) :: Solo a -> Solo b -> Solo b Source # (<*) :: Solo a -> Solo b -> Solo a Source #
Applicative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> [a] Source # (<*>) :: [a -> b] -> [a] -> [b] Source # liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] Source # (*>) :: [a] -> [b] -> [b] Source # (<*) :: [a] -> [b] -> [a] Source #
Applicative (Fold a) |
Instance details Defined in Codec.Picture.ColorQuant Methods pure :: a0 -> Fold a a0 Source # (<*>) :: Fold a (a0 -> b) -> Fold a a0 -> Fold a b Source # liftA2 :: (a0 -> b -> c) -> Fold a a0 -> Fold a b -> Fold a c Source # (*>) :: Fold a a0 -> Fold a b -> Fold a b Source # (<*) :: Fold a a0 -> Fold a b -> Fold a a0 Source #
Representable f => Applicative (Co f) |
Instance details Defined in Data.Functor.Rep Methods pure :: a -> Co f a Source # (<*>) :: Co f (a -> b) -> Co f a -> Co f b Source # liftA2 :: (a -> b -> c) -> Co f a -> Co f b -> Co f c Source # (*>) :: Co f a -> Co f b -> Co f b Source # (<*) :: Co f a -> Co f b -> Co f a Source #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a Source #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source #

Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 Source # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 Source #
Applicative (Either e) | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a Source # (<*>) :: Either e (a -> b) -> Either e a -> Either e b Source # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source # (*>) :: Either e a -> Either e b -> Either e b Source # (<*) :: Either e a -> Either e b -> Either e a Source #
Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods pure :: a -> Proxy a Source # (<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b Source # liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c Source # (*>) :: Proxy a -> Proxy b -> Proxy b Source # (<*) :: Proxy a -> Proxy b -> Proxy a Source #
Applicative (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> U1 a Source # (<*>) :: U1 (a -> b) -> U1 a -> U1 b Source # liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c Source # (*>) :: U1 a -> U1 b -> U1 b Source # (<*) :: U1 a -> U1 b -> U1 a Source #
Applicative (ST s) | Since: base-4.4.0.0
Instance details Defined in GHC.ST Methods pure :: a -> ST s a Source # (<*>) :: ST s (a -> b) -> ST s a -> ST s b Source # liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c Source # (*>) :: ST s a -> ST s b -> ST s b Source # (<*) :: ST s a -> ST s b -> ST s a Source #
Applicative (Measured n) |
Instance details Defined in Diagrams.Core.Measure Methods pure :: a -> Measured n a Source # (<*>) :: Measured n (a -> b) -> Measured n a -> Measured n b Source # liftA2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c Source # (*>) :: Measured n a -> Measured n b -> Measured n b Source # (<*) :: Measured n a -> Measured n b -> Measured n a Source #
Alternative f => Applicative (Cofree f) |
Instance details Defined in Control.Comonad.Cofree Methods pure :: a -> Cofree f a Source # (<*>) :: Cofree f (a -> b) -> Cofree f a -> Cofree f b Source # liftA2 :: (a -> b -> c) -> Cofree f a -> Cofree f b -> Cofree f c Source # (*>) :: Cofree f a -> Cofree f b -> Cofree f b Source # (<*) :: Cofree f a -> Cofree f b -> Cofree f a Source #
Functor f => Applicative (Free f) |
Instance details Defined in Control.Monad.Free Methods pure :: a -> Free f a Source # (<*>) :: Free f (a -> b) -> Free f a -> Free f b Source # liftA2 :: (a -> b -> c) -> Free f a -> Free f b -> Free f c Source # (*>) :: Free f a -> Free f b -> Free f b Source # (<*) :: Free f a -> Free f b -> Free f a Source #
Applicative f => Applicative (Yoneda f) |
Instance details Defined in Data.Functor.Yoneda Methods pure :: a -> Yoneda f a Source # (<*>) :: Yoneda f (a -> b) -> Yoneda f a -> Yoneda f b Source # liftA2 :: (a -> b -> c) -> Yoneda f a -> Yoneda f b -> Yoneda f c Source # (*>) :: Yoneda f a -> Yoneda f b -> Yoneda f b Source # (<*) :: Yoneda f a -> Yoneda f b -> Yoneda f a Source #
Applicative f => Applicative (Indexing f) |
Instance details Defined in Control.Lens.Internal.Indexed Methods pure :: a -> Indexing f a Source # (<*>) :: Indexing f (a -> b) -> Indexing f a -> Indexing f b Source # liftA2 :: (a -> b -> c) -> Indexing f a -> Indexing f b -> Indexing f c Source # (*>) :: Indexing f a -> Indexing f b -> Indexing f b Source # (<*) :: Indexing f a -> Indexing f b -> Indexing f a Source #
Applicative f => Applicative (Indexing64 f) |

Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: a -> Indexing64 f a Source #

(<*>) :: Indexing64 f (a -> b) -> Indexing64 f a -> Indexing64 f b Source #

liftA2 :: (a -> b -> c) -> Indexing64 f a -> Indexing64 f b -> Indexing64 f c Source #

(*>) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f b Source #

(<*) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f a Source #

Applicative (ReifiedFold s) |

Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedFold s a Source #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b Source #

liftA2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c Source #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b Source #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a Source #

Applicative (ReifiedGetter s) |

Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedGetter s a Source #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b Source #

liftA2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c Source #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b Source #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a Source #

Applicative f => Applicative (Point f) |
Instance details Defined in Linear.Affine Methods pure :: a -> Point f a Source # (<*>) :: Point f (a -> b) -> Point f a -> Point f b Source # liftA2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c Source # (*>) :: Point f a -> Point f b -> Point f b Source # (<*) :: Point f a -> Point f b -> Point f a Source #
Applicative (Covector r) |
Instance details Defined in Linear.Covector Methods pure :: a -> Covector r a Source # (<*>) :: Covector r (a -> b) -> Covector r a -> Covector r b Source # liftA2 :: (a -> b -> c) -> Covector r a -> Covector r b -> Covector r c Source # (*>) :: Covector r a -> Covector r b -> Covector r b Source # (<*) :: Covector r a -> Covector r b -> Covector r a Source #
Applicative (Inf p) |
Instance details Defined in Data.Monoid.Inf Methods pure :: a -> Inf p a Source # (<*>) :: Inf p (a -> b) -> Inf p a -> Inf p b Source # liftA2 :: (a -> b -> c) -> Inf p a -> Inf p b -> Inf p c Source # (*>) :: Inf p a -> Inf p b -> Inf p b Source # (<*) :: Inf p a -> Inf p b -> Inf p a Source #
Apply f => Applicative (MaybeApply f) |
Instance details Defined in Data.Functor.Bind.Class Methods pure :: a -> MaybeApply f a Source # (<*>) :: MaybeApply f (a -> b) -> MaybeApply f a -> MaybeApply f b Source # liftA2 :: (a -> b -> c) -> MaybeApply f a -> MaybeApply f b -> MaybeApply f c Source # (*>) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f b Source # (<*) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f a Source #
Applicative f => Applicative (WrappedApplicative f) |

Instance details

Defined in Data.Functor.Bind.Class

Methods

pure :: a -> WrappedApplicative f a Source #

(<*>) :: WrappedApplicative f (a -> b) -> WrappedApplicative f a -> WrappedApplicative f b Source #

liftA2 :: (a -> b -> c) -> WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f c Source #

(*>) :: WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f b Source #

(<*) :: WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f a Source #

Semigroup a => Applicative (These a) |
Instance details Defined in Data.Strict.These Methods pure :: a0 -> These a a0 Source # (<*>) :: These a (a0 -> b) -> These a a0 -> These a b Source # liftA2 :: (a0 -> b -> c) -> These a a0 -> These a b -> These a c Source # (*>) :: These a a0 -> These a b -> These a b Source # (<*) :: These a a0 -> These a b -> These a a0 Source #
Semigroup a => Applicative (These a) |
Instance details Defined in Data.These Methods pure :: a0 -> These a a0 Source # (<*>) :: These a (a0 -> b) -> These a a0 -> These a b Source # liftA2 :: (a0 -> b -> c) -> These a a0 -> These a b -> These a c Source # (*>) :: These a a0 -> These a b -> These a b Source # (<*) :: These a a0 -> These a b -> These a a0 Source #
(Functor m, Monad m) => Applicative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods pure :: a -> MaybeT m a Source # (<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b Source # liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c Source # (*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b Source # (<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a Source #

Monoid a => Applicative ((,) a)

For tuples, the `Monoid` constraint on `a` determines how the first values merge. For example, `String`s concatenate:

    ("hello ", (+15)) <*> ("world!", 2002)
    ("hello world!",2017)

Since: base-2.1

Instance details Defined in GHC.Base Methods pure :: a0 -> (a, a0) Source # (<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) Source # liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) Source # (*>) :: (a, a0) -> (a, b) -> (a, b) Source # (<*) :: (a, a0) -> (a, b) -> (a, a0) Source #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> Kleisli m a a0 Source # (<*>) :: Kleisli m a (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b Source # liftA2 :: (a0 -> b -> c) -> Kleisli m a a0 -> Kleisli m a b -> Kleisli m a c Source # (*>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source # (<*) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a a0 Source #
Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a Source # (<*>) :: Const m (a -> b) -> Const m a -> Const m b Source # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source # (*>) :: Const m a -> Const m b -> Const m b Source # (<*) :: Const m a -> Const m b -> Const m a Source #
Applicative f => Applicative (Ap f) | Since: base-4.12.0.0
Instance details Defined in Data.Monoid Methods pure :: a -> Ap f a Source # (<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b Source # liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c Source # (*>) :: Ap f a -> Ap f b -> Ap f b Source # (<*) :: Ap f a -> Ap f b -> Ap f a Source #
Applicative f => Applicative (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Alt f a Source # (<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b Source # liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c Source # (*>) :: Alt f a -> Alt f b -> Alt f b Source # (<*) :: Alt f a -> Alt f b -> Alt f a Source #
(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) | Since: base-4.17.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Generically1 f a Source #

(<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b Source #

liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c Source #

(*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b Source #

(<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a Source #

Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Rec1 f a Source # (<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b Source # liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c Source # (*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source # (<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a Source #
Biapplicative p => Applicative (Fix p) |
Instance details Defined in Data.Bifunctor.Fix Methods pure :: a -> Fix p a Source # (<*>) :: Fix p (a -> b) -> Fix p a -> Fix p b Source # liftA2 :: (a -> b -> c) -> Fix p a -> Fix p b -> Fix p c Source # (*>) :: Fix p a -> Fix p b -> Fix p b Source # (<*) :: Fix p a -> Fix p b -> Fix p a Source #
Biapplicative p => Applicative (Join p) |
Instance details Defined in Data.Bifunctor.Join Methods pure :: a -> Join p a Source # (<*>) :: Join p (a -> b) -> Join p a -> Join p b Source # liftA2 :: (a -> b -> c) -> Join p a -> Join p b -> Join p c Source # (*>) :: Join p a -> Join p b -> Join p b Source # (<*) :: Join p a -> Join p b -> Join p a Source #
(Applicative f, Monad f) => Applicative (WhenMissing f x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))`. Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMissing f x a Source #

(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c Source #

(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source #

(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a Source #

Applicative (Query v n) |
Instance details Defined in Diagrams.Core.Query Methods pure :: a -> Query v n a Source # (<*>) :: Query v n (a -> b) -> Query v n a -> Query v n b Source # liftA2 :: (a -> b -> c) -> Query v n a -> Query v n b -> Query v n c Source # (*>) :: Query v n a -> Query v n b -> Query v n b Source # (<*) :: Query v n a -> Query v n b -> Query v n a Source #
(Alternative f, Applicative w) => Applicative (CofreeT f w) |
Instance details Defined in Control.Comonad.Trans.Cofree Methods pure :: a -> CofreeT f w a Source # (<*>) :: CofreeT f w (a -> b) -> CofreeT f w a -> CofreeT f w b Source # liftA2 :: (a -> b -> c) -> CofreeT f w a -> CofreeT f w b -> CofreeT f w c Source # (*>) :: CofreeT f w a -> CofreeT f w b -> CofreeT f w b Source # (<*) :: CofreeT f w a -> CofreeT f w b -> CofreeT f w a Source #
(Functor f, Monad m) => Applicative (FreeT f m) |
Instance details Defined in Control.Monad.Trans.Free Methods pure :: a -> FreeT f m a Source # (<*>) :: FreeT f m (a -> b) -> FreeT f m a -> FreeT f m b Source # liftA2 :: (a -> b -> c) -> FreeT f m a -> FreeT f m b -> FreeT f m c Source # (*>) :: FreeT f m a -> FreeT f m b -> FreeT f m b Source # (<*) :: FreeT f m a -> FreeT f m b -> FreeT f m a Source #
Applicative f => Applicative (Indexing f) |
Instance details Defined in WithIndex Methods pure :: a -> Indexing f a Source # (<*>) :: Indexing f (a -> b) -> Indexing f a -> Indexing f b Source # liftA2 :: (a -> b -> c) -> Indexing f a -> Indexing f b -> Indexing f c Source # (*>) :: Indexing f a -> Indexing f b -> Indexing f b Source # (<*) :: Indexing f a -> Indexing f b -> Indexing f a Source #
(Applicative f, Applicative g) => Applicative (Day f g) |
Instance details Defined in Data.Functor.Day Methods pure :: a -> Day f g a Source # (<*>) :: Day f g (a -> b) -> Day f g a -> Day f g b Source # liftA2 :: (a -> b -> c) -> Day f g a -> Day f g b -> Day f g c Source # (*>) :: Day f g a -> Day f g b -> Day f g b Source # (<*) :: Day f g a -> Day f g b -> Day f g a Source #
(Functor g, g ~ h) => Applicative (Curried g h) |
Instance details Defined in Data.Functor.Day.Curried Methods pure :: a -> Curried g h a Source # (<*>) :: Curried g h (a -> b) -> Curried g h a -> Curried g h b Source # liftA2 :: (a -> b -> c) -> Curried g h a -> Curried g h b -> Curried g h c Source # (*>) :: Curried g h a -> Curried g h b -> Curried g h b Source # (<*) :: Curried g h a -> Curried g h b -> Curried g h a Source #
Applicative (Indexed i a) |
Instance details Defined in Control.Lens.Internal.Indexed Methods pure :: a0 -> Indexed i a a0 Source # (<*>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b Source # liftA2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c Source # (*>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b Source # (<*) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 Source #
Applicative (Flows i b) | This is an illegal `Applicative`.
Instance details Defined in Control.Lens.Internal.Level Methods pure :: a -> Flows i b a Source # (<*>) :: Flows i b (a -> b0) -> Flows i b a -> Flows i b b0 Source # liftA2 :: (a -> b0 -> c) -> Flows i b a -> Flows i b b0 -> Flows i b c Source # (*>) :: Flows i b a -> Flows i b b0 -> Flows i b b0 Source # (<*) :: Flows i b a -> Flows i b b0 -> Flows i b a Source #
Applicative (Mafic a b) |
Instance details Defined in Control.Lens.Internal.Magma Methods pure :: a0 -> Mafic a b a0 Source # (<*>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 Source # liftA2 :: (a0 -> b0 -> c) -> Mafic a b a0 -> Mafic a b b0 -> Mafic a b c Source # (*>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 Source # (<*) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 Source #
Monoid m => Applicative (Holes t m) |
Instance details Defined in Control.Lens.Traversal Methods pure :: a -> Holes t m a Source # (<*>) :: Holes t m (a -> b) -> Holes t m a -> Holes t m b Source # liftA2 :: (a -> b -> c) -> Holes t m a -> Holes t m b -> Holes t m c Source # (*>) :: Holes t m a -> Holes t m b -> Holes t m b Source # (<*) :: Holes t m a -> Holes t m b -> Holes t m a Source #
Dim n => Applicative (V n) |
Instance details Defined in Linear.V Methods pure :: a -> V n a Source # (<*>) :: V n (a -> b) -> V n a -> V n b Source # liftA2 :: (a -> b -> c) -> V n a -> V n b -> V n c Source # (*>) :: V n a -> V n b -> V n b Source # (<*) :: V n a -> V n b -> V n a Source #
(Profunctor p, Arrow p) => Applicative (Closure p a) |
Instance details Defined in Data.Profunctor.Closed Methods pure :: a0 -> Closure p a a0 Source # (<*>) :: Closure p a (a0 -> b) -> Closure p a a0 -> Closure p a b Source # liftA2 :: (a0 -> b -> c) -> Closure p a a0 -> Closure p a b -> Closure p a c Source # (*>) :: Closure p a a0 -> Closure p a b -> Closure p a b Source # (<*) :: Closure p a a0 -> Closure p a b -> Closure p a a0 Source #
(Applicative (Rep p), Representable p) => Applicative (Prep p) |
Instance details Defined in Data.Profunctor.Rep Methods pure :: a -> Prep p a Source # (<*>) :: Prep p (a -> b) -> Prep p a -> Prep p b Source # liftA2 :: (a -> b -> c) -> Prep p a -> Prep p b -> Prep p c Source # (*>) :: Prep p a -> Prep p b -> Prep p b Source # (<*) :: Prep p a -> Prep p b -> Prep p a Source #
(Profunctor p, Arrow p) => Applicative (Tambara p a) |
Instance details Defined in Data.Profunctor.Strong Methods pure :: a0 -> Tambara p a a0 Source # (<*>) :: Tambara p a (a0 -> b) -> Tambara p a a0 -> Tambara p a b Source # liftA2 :: (a0 -> b -> c) -> Tambara p a a0 -> Tambara p a b -> Tambara p a c Source # (*>) :: Tambara p a a0 -> Tambara p a b -> Tambara p a b Source # (<*) :: Tambara p a a0 -> Tambara p a b -> Tambara p a a0 Source #
Applicative (Tagged s) |
Instance details Defined in Data.Tagged Methods pure :: a -> Tagged s a Source # (<*>) :: Tagged s (a -> b) -> Tagged s a -> Tagged s b Source # liftA2 :: (a -> b -> c) -> Tagged s a -> Tagged s b -> Tagged s c Source # (*>) :: Tagged s a -> Tagged s b -> Tagged s b Source # (<*) :: Tagged s a -> Tagged s b -> Tagged s a Source #
Applicative f => Applicative (Backwards f) | Apply `f`-actions in the reverse order.
Instance details Defined in Control.Applicative.Backwards Methods pure :: a -> Backwards f a Source # (<*>) :: Backwards f (a -> b) -> Backwards f a -> Backwards f b Source # liftA2 :: (a -> b -> c) -> Backwards f a -> Backwards f b -> Backwards f c Source # (*>) :: Backwards f a -> Backwards f b -> Backwards f b Source # (<*) :: Backwards f a -> Backwards f b -> Backwards f a Source #
(Functor m, Monad m) => Applicative (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods pure :: a -> ErrorT e m a Source # (<*>) :: ErrorT e m (a -> b) -> ErrorT e m a -> ErrorT e m b Source # liftA2 :: (a -> b -> c) -> ErrorT e m a -> ErrorT e m b -> ErrorT e m c Source # (*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b Source # (<*) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m a Source #
(Functor m, Monad m) => Applicative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods pure :: a -> ExceptT e m a Source # (<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b Source # liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c Source # (*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b Source # (<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a Source #
Applicative m => Applicative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods pure :: a -> ReaderT r m a Source # (<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b Source # liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c Source # (*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b Source # (<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a Source #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods pure :: a -> StateT s m a Source # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source # (*>) :: StateT s m a -> StateT s m b -> StateT s m b Source # (<*) :: StateT s m a -> StateT s m b -> StateT s m a Source #
(Monoid a, Monoid b) => Applicative ((,,) a b) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, b, a0) Source # (<*>) :: (a, b, a0 -> b0) -> (a, b, a0) -> (a, b, b0) Source # liftA2 :: (a0 -> b0 -> c) -> (a, b, a0) -> (a, b, b0) -> (a, b, c) Source # (*>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) Source # (<*) :: (a, b, a0) -> (a, b, b0) -> (a, b, a0) Source #
(Applicative f, Applicative g) => Applicative (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods pure :: a -> Product f g a Source # (<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b Source # liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c Source # (*>) :: Product f g a -> Product f g b -> Product f g b Source # (<*) :: Product f g a -> Product f g b -> Product f g a Source #
(Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :*: g) a Source # (<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b Source # liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c Source # (*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source # (<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a Source #
Monoid c => Applicative (K1 i c :: Type -> Type) | Since: base-4.12.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> K1 i c a Source # (<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b Source # liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 Source # (*>) :: K1 i c a -> K1 i c b -> K1 i c b Source # (<*) :: K1 i c a -> K1 i c b -> K1 i c a Source #
Applicative (Cokleisli w a) |

Instance details

Defined in Control.Comonad

Methods

pure :: a0 -> Cokleisli w a a0 Source #

(<*>) :: Cokleisli w a (a0 -> b) -> Cokleisli w a a0 -> Cokleisli w a b Source #

liftA2 :: (a0 -> b -> c) -> Cokleisli w a a0 -> Cokleisli w a b -> Cokleisli w a c Source #

(*>) :: Cokleisli w a a0 -> Cokleisli w a b -> Cokleisli w a b Source #

(<*) :: Cokleisli w a a0 -> Cokleisli w a b -> Cokleisli w a a0 Source #

(Monad f, Applicative f) => Applicative (WhenMatched f x y) | Equivalent to `ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMatched f x y a Source #

(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c Source #

(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source #

(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a Source #

(Applicative f, Monad f) => Applicative (WhenMissing f k x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))` . Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMissing f k x a Source #

(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c Source #

(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source #

(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a Source #

Applicative (Bazaar p a b) |

Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: a0 -> Bazaar p a b a0 Source #

(<*>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c Source #

(*>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 Source #

(<*) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 Source #

Applicative (Molten i a b) |

Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> Molten i a b a0 Source #

(<*>) :: Molten i a b (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> Molten i a b a0 -> Molten i a b b0 -> Molten i a b c Source #

(*>) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b b0 Source #

(<*) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b a0 Source #

Applicative (Costar f a) |
Instance details Defined in Data.Profunctor.Types Methods pure :: a0 -> Costar f a a0 Source # (<*>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b Source # liftA2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c Source # (*>) :: Costar f a a0 -> Costar f a b -> Costar f a b Source # (<*) :: Costar f a a0 -> Costar f a b -> Costar f a a0 Source #
Applicative f => Applicative (Star f a) |
Instance details Defined in Data.Profunctor.Types Methods pure :: a0 -> Star f a a0 Source # (<*>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b Source # liftA2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c Source # (*>) :: Star f a a0 -> Star f a b -> Star f a b Source # (<*) :: Star f a a0 -> Star f a b -> Star f a a0 Source #
(Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) | Since: base-4.14.0.0
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, b, c, a0) Source # (<*>) :: (a, b, c, a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) Source # liftA2 :: (a0 -> b0 -> c0) -> (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, c0) Source # (*>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source # (<*) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, a0) Source #
Applicative ((->) r) | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> r -> a Source # (<*>) :: (r -> (a -> b)) -> (r -> a) -> r -> b Source # liftA2 :: (a -> b -> c) -> (r -> a) -> (r -> b) -> r -> c Source # (*>) :: (r -> a) -> (r -> b) -> r -> b Source # (<*) :: (r -> a) -> (r -> b) -> r -> a Source #
(Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a Source # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source # (*>) :: Compose f g a -> Compose f g b -> Compose f g b Source # (<*) :: Compose f g a -> Compose f g b -> Compose f g a Source #
(Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :.: g) a Source # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b Source # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a Source #
Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> M1 i c f a Source # (<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b Source # liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 Source # (*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source # (<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a Source #
(Monad f, Applicative f) => Applicative (WhenMatched f k x y) | Equivalent to `ReaderT k (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMatched f k x y a Source #

(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c Source #

(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source #

(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a Source #

Applicative (BazaarT p g a b) |

Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: a0 -> BazaarT p g a b a0 Source #

(<*>) :: BazaarT p g a b (a0 -> b0) -> BazaarT p g a b a0 -> BazaarT p g a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b c Source #

(*>) :: BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b b0 Source #

(<*) :: BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b a0 Source #

Applicative (TakingWhile p f a b) |

Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> TakingWhile p f a b a0 Source #

(<*>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c Source #

(*>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 Source #

(<*) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

Reifies s (ReifiedApplicative f) => Applicative (ReflectedApplicative f s) |

Instance details

Defined in Data.Reflection

Methods

pure :: a -> ReflectedApplicative f s a Source #

(<*>) :: ReflectedApplicative f s (a -> b) -> ReflectedApplicative f s a -> ReflectedApplicative f s b Source #

liftA2 :: (a -> b -> c) -> ReflectedApplicative f s a -> ReflectedApplicative f s b -> ReflectedApplicative f s c Source #

(*>) :: ReflectedApplicative f s a -> ReflectedApplicative f s b -> ReflectedApplicative f s b Source #

(<*) :: ReflectedApplicative f s a -> ReflectedApplicative f s b -> ReflectedApplicative f s a Source #

(*>) :: Applicative f => f a -> f b -> f b infixl 4 Source #

Sequence actions, discarding the value of the first argument.

#### Examples

Expand

If used in conjunction with the Applicative instance for `Maybe`, you can chain Maybe computations, with a possible "early return" in case of `Nothing`.

    >>> Just 2 *> Just 3
    Just 3

    >>> Nothing *> Just 3
    Nothing

Of course a more interesting use case would be to have effectful computations instead of just returning pure values.

    >>> import Data.Char
    >>> import Text.ParserCombinators.ReadP
    >>> let p = string "my name is " *> munch1 isAlpha <* eof
    >>> readP_to_S p "my name is Simon"
    [("Simon","")]

(<*) :: Applicative f => f a -> f b -> f a infixl 4 Source #

Sequence actions, discarding the value of the second argument.

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 Source #

An infix synonym for `fmap`.

The name of this operator is an allusion to `$`. Note the similarities between their types:

     ($)  ::              (a -> b) ->   a ->   b
    (<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas `$` is function application, `<$>` is function application lifted over a `Functor`.

#### Examples

Expand

Convert from a ``Maybe` `Int`` to a ``Maybe` `String`` using `show`:

    >>> show <$> Nothing
    Nothing
    >>> show <$> Just 3
    Just "3"

Convert from an ``Either` `Int` `Int`` to an ``Either` `Int`` `String` using `show`:

    >>> show <$> Left 17
    Left 17
    >>> show <$> Right 17
    Right "17"

Double each element of a list:

    >>> (*2) <$> [1,2,3]
    [2,4,6]

Apply `even` to the second element of a pair:

    >>> even <$> (2,2)
    (2,True)

(<$) :: Functor f => a -> f b -> f a infixl 4 Source #

Replace all locations in the input with the same value. The default definition is ``fmap` . `const``, but this may be overridden with a more efficient version.

liftA :: Applicative f => (a -> b) -> f a -> f b Source #

Lift a function to actions. Equivalent to Functor's `fmap` but implemented using only `Applicative`'s methods: `liftA f a = pure f * a`

As such this function may be used to implement a `Functor` instance from an `Applicative` one.

liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c Source #

Lift a binary function to actions.

Some functors support an implementation of `liftA2` that is more efficient than the default one. In particular, if `fmap` is an expensive operation, it is likely better to use `liftA2` than to `fmap` over the structure and then use `<*>`.

This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of `<*>` and `fmap`.

#### Example

Expand

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)

liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #

Lift a ternary function to actions.