reducers-3.12.1: 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 #

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

Constructors

MonadSum |
Fields getMonadSum :: f a

Instances

Monad f => Monad (MonadSum f) # |
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) # |
Methods fmap :: (a -> b) -> MonadSum f a -> MonadSum f b # (<$) :: a -> MonadSum f b -> MonadSum f a #
Applicative f => Applicative (MonadSum f) # |
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) # |
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) # |
Methods mzero :: MonadSum f a # mplus :: MonadSum f a -> MonadSum f a -> MonadSum f a #
MonadPlus f => Reducer (f a) (MonadSum f a) # |
Methods unit :: f a -> MonadSum f a # snoc :: MonadSum f a -> f a -> MonadSum f a # cons :: f a -> MonadSum f a -> MonadSum f a #
MonadPlus f => Semigroup (MonadSum f a) # |
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) # |
Methods mempty :: MonadSum f a # mappend :: MonadSum f a -> MonadSum f a -> MonadSum f a # mconcat :: [MonadSum f a] -> MonadSum f a #