reducers-3.12.5: 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 | Haskell2010

Data.Semigroup.Alternative

Description

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

Synopsis

- newtype Alternate (f :: Type -> Type) a = Alternate {
  - getAlternate :: f a
  }

# Documentation

newtype Alternate (f :: Type -> Type) a Source #

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

Constructors

Alternate |

Fields

- getAlternate :: f a

#### Instances

Instances details

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