Skip to main content

Module monad_plus

Module monad_plus 

Source
Expand description

Monads with a choice operator and identity element, combining Monad and Alternative.

A MonadPlus is a type that supports both monadic sequencing (Monad) and choice with an identity element (Alternative). It has no members of its own; it specifies that the type constructor has both Monad and Alternative instances.

This module is a port of PureScript’s Control.MonadPlus.

§Hierarchy

Functor
  |
  +-- Pointed + Semiapplicative --> Applicative
  |
  +-- Applicative + Semimonad ----> Monad
  |
  +-- Alt + (identity element) ---> Plus
  |
  +-- Applicative + Plus ---------> Alternative
  |
  +-- Monad + Alternative --------> MonadPlus

Traits§

MonadPlus
A type class for monads that also support choice, combining Monad and Alternative.