transformers-0.5.6.2: Concrete functor and monad transformers
Copyright (c) Ross Paterson 2010
License BSD-style (see the file LICENSE)
Maintainer R.Paterson@city.ac.uk
Stability experimental
Portability portable
Safe Haskell Safe
Language Haskell98

Control.Applicative.Lift

Description

Adding a new kind of pure computation to an applicative functor.

Synopsis

Lifting an applicative

data Lift f a Source #

Applicative functor formed by adding pure computations to a given applicative functor.

Constructors

Pure a
Other (f a)

Instances

Instances details
Functor f => Functor ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Methods

fmap :: (a -> b) -> Lift f a -> Lift f b Source #

(<$) :: a -> Lift f b -> Lift f a Source #

Applicative f => Applicative ( Lift f) Source #

A combination is Pure only if both parts are.

Instance details

Defined in Control.Applicative.Lift

Foldable f => Foldable ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Traversable f => Traversable ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Lift f a -> f0 ( Lift f b) Source #

sequenceA :: Applicative f0 => Lift f (f0 a) -> f0 ( Lift f a) Source #

mapM :: Monad m => (a -> m b) -> Lift f a -> m ( Lift f b) Source #

sequence :: Monad m => Lift f (m a) -> m ( Lift f a) Source #

Eq1 f => Eq1 ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Methods

liftEq :: (a -> b -> Bool ) -> Lift f a -> Lift f b -> Bool Source #

Ord1 f => Ord1 ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Read1 f => Read1 ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Show1 f => Show1 ( Lift f) Source #
Instance details

Defined in Control.Applicative.Lift

Alternative f => Alternative ( Lift f) Source #

A combination is Pure only either part is.

Instance details

Defined in Control.Applicative.Lift

( Eq1 f, Eq a) => Eq ( Lift f a) Source #
Instance details

Defined in Control.Applicative.Lift

( Ord1 f, Ord a) => Ord ( Lift f a) Source #
Instance details

Defined in Control.Applicative.Lift

( Read1 f, Read a) => Read ( Lift f a) Source #
Instance details

Defined in Control.Applicative.Lift

( Show1 f, Show a) => Show ( Lift f a) Source #
Instance details

Defined in Control.Applicative.Lift

unLift :: Applicative f => Lift f a -> f a Source #

Projection to the other functor.

mapLift :: (f a -> g a) -> Lift f a -> Lift g a Source #

Apply a transformation to the other computation.

elimLift :: (a -> r) -> (f a -> r) -> Lift f a -> r Source #

Eliminator for Lift .

Collecting errors

type Errors e = Lift ( Constant e) Source #

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 ExceptT from Control.Monad.Trans.Except , these computations continue after an error, collecting all the errors.

runErrors :: Errors e a -> Either e a Source #

Extractor for computations with accumulating errors.

failure :: e -> Errors e a Source #

Report an error.