Portability | rank 2 types, MPTCs |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Inferred |
- type IndexedGetter i s a = forall k f. (Indexable i k, Gettable f) => k (a -> f a) (s -> f s)
- type IndexedGetting i m s t a b = Indexed i (a -> Accessor m b) (s -> Accessor m t)
- newtype ReifiedIndexedGetter i s a = ReifyIndexedGetter {
- reflectIndexedGetter :: IndexedGetter i s a
- iview :: MonadReader s m => IndexedGetting i (i, a) s t a b -> m (i, a)
- iviews :: MonadReader s m => IndexedGetting i r s t a b -> (i -> a -> r) -> m r
- iuse :: MonadState s m => IndexedGetting i (i, a) s t a b -> m (i, a)
- iuses :: MonadState s m => IndexedGetting i r s t a b -> (i -> a -> r) -> m r
Indexed Getters
type IndexedGetter i s a = forall k f. (Indexable i k, Gettable f) => k (a -> f a) (s -> f s)Source
Every IndexedGetter
is a valid IndexedFold
and Getter
.
type IndexedGetting i m s t a b = Indexed i (a -> Accessor m b) (s -> Accessor m t)Source
Used to consume an IndexedFold
.
newtype ReifiedIndexedGetter i s a Source
Useful for storage.
Indexed Getter Combinators
iview :: MonadReader s m => IndexedGetting i (i, a) s t a b -> 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 t a b -> (i -> a -> r) -> m rSource
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 t a b -> 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 t a b -> (i -> a -> r) -> m rSource
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.