monadplus-1.4.1: Haskell98 partial maps and filters over MonadPlus.

Portabilitynon-portable (TF,GNTD)
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellSafe-Inferred

Control.Applicative.Alternative

Contents

Description

Partial maps and filters over Alternative instances.

This is considerably weaker than MonadPlus, as we have no possibility of removing intermediate structure, as in mcatMaybes.

Synopsis

Basics

asum :: (Foldable t, Alternative f) => t (f a) -> f a

The sum of a collection of actions, generalizing concat.

Constructing

afold :: (Alternative f, Foldable t) => t a -> f aSource

Fold a value into an arbitrary MonadPlus type.

This function generalizes the toList function.

afromList :: Alternative f => [a] -> f aSource

This function generalizes the listToMaybe function.

afromMaybe :: Alternative f => Maybe a -> f aSource

Translate maybe to an arbitrary Alternative type.

This function generalizes the maybeToList function.