Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

This module defines the `MonoidApplicative`

and `MonoidAlternative`

type classes. Their methods are specialized
forms of the standard `Applicative`

and `Alternative`

class methods. Instances of these classes should override the
default method implementations with more efficient ones.

# Documentation

class Applicative f => MonoidApplicative f where Source #

class (Alternative f, MonoidApplicative f) => MonoidAlternative f where Source #

moptional :: (Semigroup a, Monoid a) => f a -> f a Source #

Like `optional`

, but restricted to `Monoid`

results.

concatMany :: (Semigroup a, Monoid a) => f a -> f a Source #

Zero or more argument occurrences like `many`

, but concatenated.

concatSome :: (Semigroup a, Monoid a) => f a -> f a Source #

One or more argument occurrences like `some`

, but concatenated.

(Alternative (Parser t s), Monoid s) => MonoidAlternative (Parser t s) Source # | |