Portability | MTPCs, FDs, Rank2 |
---|---|

Stability | experimental |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Safe Haskell | Safe-Infered |

- type Action m a c = forall f b r d. Effective m r f => (c -> f d) -> a -> f b
- act :: Monad m => (a -> m c) -> Action m a c
- acts :: Action m (m a) a
- perform :: Monad m => Acting m c a b c d -> a -> m c
- liftAct :: (MonadTrans t, Monad m) => Acting m c a b c d -> Action (t m) a c
- (^!) :: Monad m => a -> Acting m c a b c d -> m c
- type MonadicFold m a c = forall f b r d. (Effective m r f, Applicative f) => (c -> f d) -> a -> f b
- type Acting m r a b c d = (c -> Effect m r d) -> a -> Effect m r b
- class (Monad m, Gettable f) => Effective m r f | f -> m r where
- effective :: Isomorphic k => k (m r) (f a)

- ineffective :: Effective m r f => Isomorphic k => k (f a) (m r)
- newtype Effect m r a = Effect {
- getEffect :: m r

# Composable Actions

# Folds with Effecs

type MonadicFold m a c = forall f b r d. (Effective m r f, Applicative f) => (c -> f d) -> a -> f bSource

A `MonadicFold`

is a `Fold`

enriched with access to a `Monad`

for side-effects.

Every `Fold`

can be used as a `MonadicFold`

, that simply ignores the access to the `Monad`

.

You can compose a `MonadicFold`

with another `MonadicFold`

using (`.`

) from the `Prelude`

.

# Implementation Details

class (Monad m, Gettable f) => Effective m r f | f -> m r whereSource

An `Effective`

`Functor`

ignores its argument and is isomorphic to a monad wrapped around a value.

That said, the monad is possibly rather unrelated to any `Applicative`

structure.

effective :: Isomorphic k => k (m r) (f a)Source

ineffective :: Effective m r f => Isomorphic k => k (f a) (m r)Source

A convenient antonym that is used internally.