Data.Semigroup.Alternative

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.Alternative

Description

A semigroup for working with `Alternative` `Functor`s.

Synopsis

- newtype Alternate f a = Alternate {
  - getAlternate :: f a
  }

# Documentation

newtype Alternate f a #

A `Alternate` turns any `Alternative` instance into a `Monoid`.

Constructors

Alternate |
Fields getAlternate :: f a

Instances

Functor f => Functor (Alternate f) # |
Methods fmap :: (a -> b) -> Alternate f a -> Alternate f b # (<$) :: a -> Alternate f b -> Alternate f a #
Applicative f => Applicative (Alternate f) # |
Methods pure :: a -> Alternate f a # (<*>) :: Alternate f (a -> b) -> Alternate f a -> Alternate f b # (*>) :: Alternate f a -> Alternate f b -> Alternate f b # (<*) :: Alternate f a -> Alternate f b -> Alternate f a #
Alternative f => Alternative (Alternate f) # |
Methods empty :: Alternate f a # (<|>) :: Alternate f a -> Alternate f a -> Alternate f a # some :: Alternate f a -> Alternate f [a] # many :: Alternate f a -> Alternate f [a] #
Alternative f => Reducer (f a) (Alternate f a) # |
Methods unit :: f a -> Alternate f a # snoc :: Alternate f a -> f a -> Alternate f a # cons :: f a -> Alternate f a -> Alternate f a #
Alternative f => Semigroup (Alternate f a) # |
Methods (<>) :: Alternate f a -> Alternate f a -> Alternate f a # sconcat :: NonEmpty (Alternate f a) -> Alternate f a # stimes :: Integral b => b -> Alternate f a -> Alternate f a #
Alternative f => Monoid (Alternate f a) # |
Methods mempty :: Alternate f a # mappend :: Alternate f a -> Alternate f a -> Alternate f a # mconcat :: [Alternate f a] -> Alternate f a #