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

Copyright(c) Hans Hoglund 2012
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilitynon-portable (TF,GNTD)
Safe HaskellSafe
LanguageHaskell98

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 a #

Fold a value into an arbitrary MonadPlus type.

This function generalizes the toList function.

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

This function generalizes the listToMaybe function.

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

Translate maybe to an arbitrary Alternative type.

This function generalizes the maybeToList function.