Portability | rank 2 types, MPTCs, TFs, flexible |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Inferred |
- 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
- iover :: Overloaded (Index i) Mutator a b c d -> (i -> c -> d) -> a -> b
- isets :: ((i -> c -> d) -> a -> b) -> IndexedSetter i a b c d
- (%@~) :: 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 ()
- newtype ReifiedIndexedSetter i a b c d = ReifyIndexedSetter {
- reflectIndexedSetter :: IndexedSetter i a b c d
- type SimpleIndexedSetter i a b = IndexedSetter i a a b b
- type SimpleReifiedIndexedSetter i a b = ReifiedIndexedSetter 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.
mapOf
l ≡imapOf
l.
const
imapOf
::IndexedSetter
i a b c d -> (i -> c -> d) -> a -> bimapOf
::IndexedLens
i a b c d -> (i -> c -> d) -> a -> bimapOf
::IndexedTraversal
i a b c d -> (i -> c -> d) -> a -> b
iover :: Overloaded (Index i) Mutator a b c d -> (i -> c -> d) -> a -> bSource
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
::IndexedSetter
i a b c d -> (i -> c -> d) -> a -> biover
::IndexedLens
i a b c d -> (i -> c -> d) -> a -> biover
::IndexedTraversal
i a b c d -> (i -> c -> d) -> a -> b
isets :: ((i -> c -> d) -> a -> b) -> IndexedSetter i a b c dSource
(%@~) :: 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%@~
const
f
(%@~
) ::IndexedSetter
i a b c d -> (i -> c -> d) -> a -> b (%@~
) ::IndexedLens
i a b c d -> (i -> c -> d) -> a -> b (%@~
) ::IndexedTraversal
i 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%@=
const
f
(%@=
) ::MonadState
a m =>IndexedSetter
i a a c d -> (i -> c -> d) -> m () (%@=
) ::MonadState
a m =>IndexedLens
i a a c d -> (i -> c -> d) -> m () (%@=
) ::MonadState
a m =>IndexedTraversal
i a b c d -> (i -> c -> d) -> m ()
Storing Indexed Setters
newtype ReifiedIndexedSetter i a b c d Source
Useful for storage.
ReifyIndexedSetter | |
|
Simple
type SimpleIndexedSetter i a b = IndexedSetter i a a b bSource
typeSimpleIndexedSetter
i =Simple
(IndexedSetter
i)
type SimpleReifiedIndexedSetter i a b = ReifiedIndexedSetter i a a b bSource
typeSimpleIndexedSetter
i =Simple
(ReifiedIndexedSetter
i)