monoids-0.3.2: Deprecated: Use 'reducers'

Portabilitynon-portable (MPTCs)
Stabilityexperimental
Maintainerekmett@gmail.com
Safe HaskellNone

Data.Monoid.Applicative

Description

Monoids for working with an Applicative Functor.

Synopsis

Documentation

newtype Traversal f 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

newtype Alt f a Source

A Alt turns any Alternative instance into a Monoid. It also provides a Multiplicative instance for an Applicative functor wrapped around a Monoid and asserts that any Alternative applied to a Monoid forms a RightSemiNearRing under these operations.

Constructors

Alt 

Fields

getAlt :: f a
 

Instances

Functor f => Functor (Alt f) 
Applicative f => Applicative (Alt f) 
Alternative f => Alternative (Alt f) 
Alternative f => Reducer (f a) (Alt f a) 
Eq (f a) => Eq (Alt f a) 
Ord (f a) => Ord (Alt f a) 
Read (f a) => Read (Alt f a) 
Show (f a) => Show (Alt f a) 
Alternative f => Monoid (Alt f a) 
(Applicative f, Monoid a) => Multiplicative (Alt f a) 

newtype App f m Source

if m is a Module over r and f is a Applicative then f App m is a Module over r as well

Constructors

App 

Fields

getApp :: f m
 

Instances

(Reducer c m, Applicative f) => Reducer c (App f m) 
Functor f => Functor (App f) 
Applicative f => Applicative (App f) 
Alternative f => Alternative (App f) 
Eq (f m) => Eq (App f m) 
Ord (f m) => Ord (App f m) 
Read (f m) => Read (App f m) 
Show (f m) => Show (App f m) 
(Monoid m, Applicative f) => Monoid (App f m) 
(Group m, Applicative f) => Group (App f m) 

snocTraversal :: Reducer (f ()) (Traversal f) => Traversal f -> f () -> Traversal fSource

Efficiently avoid needlessly rebinding when using snoc on an action that already returns () A rewrite rule automatically applies this when possible