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

Data.Semigroup.Applicative

Description

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

Synopsis

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

# Documentation

newtype Traversal (f :: Type -> Type) Source #

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

Instances details

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

newtype Ap (f :: Type -> Type) m Source #

Constructors

Ap |

Fields

- getAp :: f m

#### Instances

Instances details

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