reducers-3.12.1: Semigroups, specialized containers and a general map/reduce framework

Copyright | (c) Edward Kmett 2009
License | BSD-style
Maintainer | ekmett@gmail.com
Stability | experimental
Portability | non-portable (MPTCs)
Safe Haskell | Trustworthy
Language | Haskell98

Data.Semigroup.Applicative

Description

Semigroups for working with `Applicative` `Functor`s.

Synopsis

- newtype Traversal f = Traversal {
  - getTraversal :: f ()
  }
- newtype Ap f m = Ap {
  - getAp :: f m
  }

# Documentation

newtype Traversal f #

A `Traversal` uses an glues together `Applicative` actions with (*>) in the manner of `traverse_` from Data.Foldable. Any values returned by reduced actions are discarded.

Constructors

Traversal |
Fields getTraversal :: f ()

Instances

Applicative f => Semigroup (Traversal f) # |
Methods (<>) :: Traversal f -> Traversal f -> Traversal f # sconcat :: NonEmpty (Traversal f) -> Traversal f # stimes :: Integral b => b -> Traversal f -> Traversal f #
Applicative f => Monoid (Traversal f) # |
Methods mempty :: Traversal f # mappend :: Traversal f -> Traversal f -> Traversal f # mconcat :: [Traversal f] -> Traversal f #
Applicative f => Reducer (f a) (Traversal f) # |
Methods unit :: f a -> Traversal f # snoc :: Traversal f -> f a -> Traversal f # cons :: f a -> Traversal f -> Traversal f #

newtype Ap f m #

Constructors

Ap |
Fields getAp :: f m

Instances

Functor f => Functor (Ap f) # |
Methods fmap :: (a -> b) -> Ap f a -> Ap f b # (<$) :: a -> Ap f b -> Ap f a #
Applicative f => Applicative (Ap f) # |
Methods pure :: a -> Ap f a # (<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b # (*>) :: Ap f a -> Ap f b -> Ap f b # (<*) :: Ap f a -> Ap f b -> Ap f a #
(Applicative f, Reducer c m) => Reducer (f c) (Ap f m) # |
Methods unit :: f c -> Ap f m # snoc :: Ap f m -> f c -> Ap f m # cons :: f c -> Ap f m -> Ap f m #
(Applicative f, Semigroup m) => Semigroup (Ap f m) # |
Methods (<>) :: Ap f m -> Ap f m -> Ap f m # sconcat :: NonEmpty (Ap f m) -> Ap f m # stimes :: Integral b => b -> Ap f m -> Ap f m #
(Applicative f, Monoid m) => Monoid (Ap f m) # |
Methods mempty :: Ap f m # mappend :: Ap f m -> Ap f m -> Ap f m # mconcat :: [Ap f m] -> Ap f m #