| Portability | rank 2 types, MPTCs, TFs, flexible | 
|---|---|
| Stability | provisional | 
| Maintainer | Edward Kmett <ekmett@gmail.com> | 
| Safe Haskell | Safe-Infered | 
Control.Lens.IndexedSetter
Contents
Description
- type IndexedSetter i a b c d = forall f k. (Indexed i k, Settable f) => k (c -> f d) (a -> f b)
- imapOf :: Overloaded (Index i) Mutator a b c d -> (i -> c -> d) -> a -> b
- (%@~) :: Overloaded (Index i) Mutator a b c d -> (i -> c -> d) -> a -> b
- (%@=) :: MonadState a m => Overloaded (Index i) Mutator a a c d -> (i -> c -> d) -> m ()
- type SimpleIndexedSetter i a b = IndexedSetter i a a b b
Indexed Setter
type IndexedSetter i a b c d = forall f k. (Indexed i k, Settable f) => k (c -> f d) (a -> f b)Source
Every IndexedSetter is a valid Setter
The Setter laws are still required to hold.
imapOf :: Overloaded (Index i) Mutator a b c d -> (i -> c -> d) -> a -> bSource
Map with index.
When you do not need access to the index, then mapOf is more liberal in what it can accept.
mapOfl =imapOfl .const
imapOf ::IndexedSetteri a b c d -> (i -> c -> d) -> a -> b imapOf ::IndexedLensi a b c d -> (i -> c -> d) -> a -> b imapOf ::IndexedTraversali a b c d -> (i -> c -> d) -> a -> b
(%@~) :: Overloaded (Index i) Mutator a b c d -> (i -> c -> d) -> a -> bSource
Adjust every target of an IndexedSetter, IndexedLens or IndexedTraversal
 with access to the index.
(%@~) =imapOf
When you do not need access to the index then (%@~) is more liberal in what it can accept.
l%~f = l%@~constf
(%@~) ::IndexedSetteri a b c d -> (i -> c -> d) -> a -> b (%@~) ::IndexedLensi a b c d -> (i -> c -> d) -> a -> b (%@~) ::IndexedTraversali a b c d -> (i -> c -> d) -> a -> b
(%@=) :: MonadState a m => Overloaded (Index i) Mutator a a c d -> (i -> c -> d) -> m ()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%@=constf
(%@=) ::MonadStatea m =>IndexedSetteri a a c d -> (i -> c -> d) -> m () (%@=) ::MonadStatea m =>IndexedLensi a a c d -> (i -> c -> d) -> m () (%@=) ::MonadStatea m =>IndexedTraversali a b c d -> (i -> c -> d) -> m ()
Simple
type SimpleIndexedSetter i a b = IndexedSetter i a a b bSource
typeSimpleIndexedSetteri =Simple(IndexedSetteri)