reducers-3.12.3: 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 # |
Instance details Defined in Data.Semigroup.MonadPlus Methods (>>=) :: MonadSum f a -> (a -> MonadSum f b) -> MonadSum f b Source # (>>) :: MonadSum f a -> MonadSum f b -> MonadSum f b Source # return :: a -> MonadSum f a Source # fail :: String -> MonadSum f a Source #
Functor f => Functor (MonadSum f) Source # |
Instance details Defined in Data.Semigroup.MonadPlus Methods fmap :: (a -> b) -> MonadSum f a -> MonadSum f b Source # (<$) :: a -> MonadSum f b -> MonadSum f a Source #
Applicative f => Applicative (MonadSum f) Source # |
Instance details Defined in Data.Semigroup.MonadPlus Methods pure :: a -> MonadSum f a Source # (<*>) :: MonadSum f (a -> b) -> MonadSum f a -> MonadSum f b Source # liftA2 :: (a -> b -> c) -> MonadSum f a -> MonadSum f b -> MonadSum f c Source # (*>) :: MonadSum f a -> MonadSum f b -> MonadSum f b Source # (<*) :: MonadSum f a -> MonadSum f b -> MonadSum f a Source #
Alternative f => Alternative (MonadSum f) Source # |
Instance details Defined in Data.Semigroup.MonadPlus Methods empty :: MonadSum f a Source # (<|>) :: MonadSum f a -> MonadSum f a -> MonadSum f a Source # some :: MonadSum f a -> MonadSum f [a] Source # many :: MonadSum f a -> MonadSum f [a] Source #
MonadPlus f => MonadPlus (MonadSum f) Source # |
Instance details Defined in Data.Semigroup.MonadPlus Methods mzero :: MonadSum f a Source # mplus :: MonadSum f a -> MonadSum f a -> MonadSum f a Source #
MonadPlus f => Reducer (f a) (MonadSum f a) Source # |
Instance details Defined in Data.Semigroup.MonadPlus 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 # |
Instance details Defined in Data.Semigroup.MonadPlus Methods (<>) :: MonadSum f a -> MonadSum f a -> MonadSum f a Source # sconcat :: NonEmpty (MonadSum f a) -> MonadSum f a Source # stimes :: Integral b => b -> MonadSum f a -> MonadSum f a Source #
MonadPlus f => Monoid (MonadSum f a) Source # |
Instance details Defined in Data.Semigroup.MonadPlus Methods mempty :: MonadSum f a Source # mappend :: MonadSum f a -> MonadSum f a -> MonadSum f a Source # mconcat :: [MonadSum f a] -> MonadSum f a Source #