reducers-3.12.4: Semigroups, specialized containers and a general map/reduce framework
Copyright(c) Edward Kmett 2009-2011
LicenseBSD-style
Maintainerekmett@gmail.com
Stabilityexperimental
Portabilitynon-portable (MPTCs)
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Semigroup.Alternative

Description

A semigroup for working with Alternative Functors.

Synopsis

Documentation

newtype Alternate f a Source #

A Alternate turns any Alternative instance into a Monoid.

Constructors

Alternate 

Fields

Instances

Instances details
Functor f => Functor (Alternate f) Source # 
Instance details

Defined in Data.Semigroup.Alternative

Methods

fmap :: (a -> b) -> Alternate f a -> Alternate f b #

(<$) :: a -> Alternate f b -> Alternate f a #

Applicative f => Applicative (Alternate f) Source # 
Instance details

Defined in Data.Semigroup.Alternative

Methods

pure :: a -> Alternate f a #

(<*>) :: Alternate f (a -> b) -> Alternate f a -> Alternate f b #

liftA2 :: (a -> b -> c) -> Alternate f a -> Alternate f b -> Alternate f c #

(*>) :: Alternate f a -> Alternate f b -> Alternate f b #

(<*) :: Alternate f a -> Alternate f b -> Alternate f a #

Alternative f => Alternative (Alternate f) Source # 
Instance details

Defined in Data.Semigroup.Alternative

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) Source # 
Instance details

Defined in Data.Semigroup.Alternative

Methods

unit :: f a -> Alternate f a Source #

snoc :: Alternate f a -> f a -> Alternate f a Source #

cons :: f a -> Alternate f a -> Alternate f a Source #

Alternative f => Semigroup (Alternate f a) Source # 
Instance details

Defined in Data.Semigroup.Alternative

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) Source # 
Instance details

Defined in Data.Semigroup.Alternative

Methods

mempty :: Alternate f a #

mappend :: Alternate f a -> Alternate f a -> Alternate f a #

mconcat :: [Alternate f a] -> Alternate f a #