| Portability | rank 2 types, MPTCs, TFs, flexible | 
|---|---|
| Stability | provisional | 
| Maintainer | Edward Kmett <ekmett@gmail.com> | 
| Safe Haskell | Safe-Infered | 
Control.Lens.IndexedLens
Contents
Description
- type IndexedLens i a b c d = forall f k. (Indexed i k, Functor f) => k (c -> f d) (a -> f b)
- (%%@~) :: Overloaded (Index i) f a b c d -> (i -> c -> f d) -> a -> f b
- (<%@~) :: Overloaded (Index i) ((,) d) a b c d -> (i -> c -> d) -> a -> (d, b)
- (%%@=) :: MonadState a m => Overloaded (Index i) ((,) e) a a c d -> (i -> c -> (e, d)) -> m e
- (<%@=) :: MonadState a m => Overloaded (Index i) ((,) d) a a c d -> (i -> c -> d) -> m d
- type SimpleIndexedLens i a b = IndexedLens i a a b b
Indexed Lenses
type IndexedLens i a b c d = forall f k. (Indexed i k, Functor f) => k (c -> f d) (a -> f b)Source
Every IndexedLens is a valid Lens and a valid IndexedTraversal.
(%%@~) :: Overloaded (Index i) f a b c d -> (i -> c -> f d) -> a -> f bSource
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
(%%@~) ::Functorf =>IndexedLensi a b c d -> (i -> c -> f d) -> a -> f b (%%@~) ::Functorf =>IndexedTraversali a b c d -> (i -> c -> f d) -> a -> f b
In particular, it is often useful to think of this function as having one of these even more restrictive type signatures
(%%@~) ::IndexedLensi a b c d -> (i -> c -> (e, d)) -> a -> (e, b) (%%@~) ::Monoide =>IndexedTraversali a b c d -> (i -> c -> (e, d)) -> a -> (e, b)
(<%@~) :: Overloaded (Index i) ((,) d) a b c d -> (i -> c -> d) -> a -> (d, b)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<%@~constf
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 (%~).
(<%@~) ::IndexedLensi a b c d -> (i -> c -> d) -> a -> (d, b) (<%@~) ::Monoidd =>IndexedTraversali a b c d -> (i -> c -> d) -> a -> (d, b)
(%%@=) :: MonadState a m => Overloaded (Index i) ((,) e) a a c d -> (i -> c -> (e, d)) -> m eSource
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)
(%%@=) ::MonadStatea mIndexedLensi a a c d -> (i -> c -> (e, d)) -> a -> m e (%%@=) :: (MonadStatea m,Monoide) =>IndexedTraversali a a c d -> (i -> c -> (e, d)) -> a -> m e
(<%@=) :: MonadState a m => Overloaded (Index i) ((,) d) a a c d -> (i -> c -> d) -> m dSource
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.
(<%@=) ::MonadStatea mIndexedLensi a a c d -> (i -> c -> d) -> a -> m d (<%@=) :: (MonadStatea m,Monoide) =>IndexedTraversali a a c d -> (i -> c -> d) -> a -> m d
Simple
type SimpleIndexedLens i a b = IndexedLens i a a b bSource
typeSimpleIndexedLensi =Simple(IndexedLensi)