Portability | portable |
---|---|
Stability | experimental |
Maintainer | ross@soi.city.ac.uk |
Safe Haskell | Safe-Inferred |
Control.Applicative.Lift
Contents
Description
Adding a new kind of pure computation to an applicative functor.
Documentation
data Lift f a
Applicative functor formed by adding pure computations to a given applicative functor.
Instances
Functor f => Functor (Lift f) | |
(Functor (Lift f), Applicative f) => Applicative (Lift f) | A combination is |
Foldable f => Foldable (Lift f) | |
(Functor (Lift f), Foldable (Lift f), Traversable f) => Traversable (Lift f) | |
(Applicative (Lift f), Alternative f) => Alternative (Lift f) | A combination is |
unLift :: Applicative f => Lift f a -> f a
Projection to the other functor.
Collecting errors
type Errors e = Lift (Constant e)
An applicative functor that collects a monoid (e.g. lists) of errors.
A sequence of computations fails if any of its components do, but
unlike monads made with ErrorT
from Control.Monad.Trans.Error,
these computations continue after an error, collecting all the errors.