Data.Semigroup.Monad

reducers-3.12.1: Semigroups, specialized containers and a general map/reduce framework

Copyright | (c) Edward Kmett 2009
License | BSD-style
Maintainer | ekmett@gmail.com
Stability | experimental
Portability | non-portable (MPTCs)
Safe Haskell | Trustworthy
Language | Haskell98

Data.Semigroup.Monad

Description

Semigroups for working with `Monad`s.

Synopsis

- newtype Action f = Action {
  - getAction :: f ()
  }
- newtype Mon f m = Mon {
  - getMon :: f m
  }

# Documentation

newtype Action f

A `Action` uses an glues together monadic actions with (>>) in the manner of `mapM_` from Data.Foldable. Any values returned by reduced actions are discarded.

Constructors

Action |
Fields getAction :: f ()

Instances

Monad f => Monoid (Action f) |
Monad f => Semigroup (Action f) |
Monad f => Reducer (f a) (Action f) |

newtype Mon f m

Constructors

Mon |
Fields getMon :: f m

Instances

Monad f => Monad (Mon f) |
Functor f => Functor (Mon f) |
Applicative f => Applicative (Mon f) |
(Monad f, Reducer c m) => Reducer (f c) (Mon f m) |
(Monad f, Monoid m) => Monoid (Mon f m) |
(Monad f, Semigroup m) => Semigroup (Mon f m) |