alternative-extra-0.1.0.0: Extra utilities for alternatives

Safe HaskellSafe
LanguageHaskell2010

Control.AlternativeExtra

Description

Utilities extending Control.Applicative

Synopsis

Documentation

mmany :: (Alternative a, Monoid m) => a m -> a m Source #

Many generalization for Monoid instances

msome :: (Alternative a, Monoid m) => a m -> a m Source #

Some generatlization for Monoid instances

manyWith :: (Alternative a, Monoid m) => (v -> m) -> (m -> v) -> a v -> a v Source #

Utility for casting bare values into a Monoid in mmany.

For example, the function:

 let sumMany = manyWith Sum getSum

will sum the results of many.

someWith :: (Alternative a, Monoid m) => (v -> m) -> (m -> v) -> a v -> a v Source #

Utility for casting bare values into a Monoid in msome.

For example, the function:

let sumSome = someWith Sum getSum

will sum the results of some.

($<) :: Applicative m => m (a -> b) -> a -> m b Source #

Function application with lifted parameter