reducers-3.12.5: 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 | Haskell2010

Data.Semigroup.Monad

Description

Semigroups for working with `Monad`s.

Synopsis

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

# Documentation

newtype Action (f :: Type -> Type) Source #

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

Instances details

Monad f => Monoid (Action f) Source # |
Instance details Defined in Data.Semigroup.Monad Methods mempty :: Action f Source # mappend :: Action f -> Action f -> Action f Source # mconcat :: [Action f] -> Action f Source #
Monad f => Semigroup (Action f) Source # |
Instance details Defined in Data.Semigroup.Monad Methods (<>) :: Action f -> Action f -> Action f Source # sconcat :: NonEmpty (Action f) -> Action f Source # stimes :: Integral b => b -> Action f -> Action f Source #
Monad f => Reducer (f a) (Action f) Source # |
Instance details Defined in Data.Semigroup.Monad Methods unit :: f a -> Action f Source # snoc :: Action f -> f a -> Action f Source # cons :: f a -> Action f -> Action f Source #

newtype Mon (f :: Type -> Type) m Source #

Constructors

Mon |

Fields

- getMon :: f m

#### Instances

Instances details

Applicative f => Applicative (Mon f) Source # |
Instance details Defined in Data.Semigroup.Monad Methods pure :: a -> Mon f a Source # (<*>) :: Mon f (a -> b) -> Mon f a -> Mon f b Source # liftA2 :: (a -> b -> c) -> Mon f a -> Mon f b -> Mon f c Source # (*>) :: Mon f a -> Mon f b -> Mon f b Source # (<*) :: Mon f a -> Mon f b -> Mon f a Source #
Functor f => Functor (Mon f) Source # |
Instance details Defined in Data.Semigroup.Monad Methods fmap :: (a -> b) -> Mon f a -> Mon f b Source # (<$) :: a -> Mon f b -> Mon f a Source #
Monad f => Monad (Mon f) Source # |
Instance details Defined in Data.Semigroup.Monad Methods (>>=) :: Mon f a -> (a -> Mon f b) -> Mon f b Source # (>>) :: Mon f a -> Mon f b -> Mon f b Source # return :: a -> Mon f a Source #
(Monad f, Reducer c m) => Reducer (f c) (Mon f m) Source # |
Instance details Defined in Data.Semigroup.Monad Methods unit :: f c -> Mon f m Source # snoc :: Mon f m -> f c -> Mon f m Source # cons :: f c -> Mon f m -> Mon f m Source #
(Monad f, Monoid m) => Monoid (Mon f m) Source # |
Instance details Defined in Data.Semigroup.Monad Methods mempty :: Mon f m Source # mappend :: Mon f m -> Mon f m -> Mon f m Source # mconcat :: [Mon f m] -> Mon f m Source #
(Monad f, Semigroup m) => Semigroup (Mon f m) Source # |
Instance details Defined in Data.Semigroup.Monad Methods (<>) :: Mon f m -> Mon f m -> Mon f m Source # sconcat :: NonEmpty (Mon f m) -> Mon f m Source # stimes :: Integral b => b -> Mon f m -> Mon f m Source #