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

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

Data.Semigroup.MonadPlus

Description

A semigroup for working with instances of `MonadPlus`

Synopsis

- newtype MonadSum f a = MonadSum {
  - getMonadSum :: f a
  }

# Documentation

newtype MonadSum f a Source #

A `MonadSum` turns any `MonadPlus` instance into a `Monoid`.

Constructors

MonadSum |

Fields

- getMonadSum :: f a

Instances

Monad f => Monad (MonadSum f) Source # |
Methods (>>=) :: MonadSum f a -> (a -> MonadSum f b) -> MonadSum f b # (>>) :: MonadSum f a -> MonadSum f b -> MonadSum f b # return :: a -> MonadSum f a # fail :: String -> MonadSum f a #
Functor f => Functor (MonadSum f) Source # |
Methods fmap :: (a -> b) -> MonadSum f a -> MonadSum f b # (<$) :: a -> MonadSum f b -> MonadSum f a #
Applicative f => Applicative (MonadSum f) Source # |
Methods pure :: a -> MonadSum f a # (<*>) :: MonadSum f (a -> b) -> MonadSum f a -> MonadSum f b # (*>) :: MonadSum f a -> MonadSum f b -> MonadSum f b # (<*) :: MonadSum f a -> MonadSum f b -> MonadSum f a #
Alternative f => Alternative (MonadSum f) Source # |
Methods empty :: MonadSum f a # (<|>) :: MonadSum f a -> MonadSum f a -> MonadSum f a # some :: MonadSum f a -> MonadSum f [a] # many :: MonadSum f a -> MonadSum f [a] #
MonadPlus f => MonadPlus (MonadSum f) Source # |
Methods mzero :: MonadSum f a # mplus :: MonadSum f a -> MonadSum f a -> MonadSum f a #
MonadPlus f => Reducer (f a) (MonadSum f a) Source # |
Methods unit :: f a -> MonadSum f a Source # snoc :: MonadSum f a -> f a -> MonadSum f a Source # cons :: f a -> MonadSum f a -> MonadSum f a Source #
MonadPlus f => Semigroup (MonadSum f a) Source # |
Methods (<>) :: MonadSum f a -> MonadSum f a -> MonadSum f a # sconcat :: NonEmpty (MonadSum f a) -> MonadSum f a # stimes :: Integral b => b -> MonadSum f a -> MonadSum f a #
MonadPlus f => Monoid (MonadSum f a) Source # |
Methods mempty :: MonadSum f a # mappend :: MonadSum f a -> MonadSum f a -> MonadSum f a # mconcat :: [MonadSum f a] -> MonadSum f a #