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 | Haskell2010 |
Adding a new kind of pure computation to an applicative functor.
Lifting an applicative
Applicative functor formed by adding pure computations to a given applicative functor.
Instances
Generic1 (Lift f :: Type -> Type) Source # | |
Foldable f => Foldable (Lift f) Source # | |
Defined in Control.Applicative.Lift fold :: Monoid m => Lift f m -> m # foldMap :: Monoid m => (a -> m) -> Lift f a -> m # foldMap' :: Monoid m => (a -> m) -> Lift f a -> m # foldr :: (a -> b -> b) -> b -> Lift f a -> b # foldr' :: (a -> b -> b) -> b -> Lift f a -> b # foldl :: (b -> a -> b) -> b -> Lift f a -> b # foldl' :: (b -> a -> b) -> b -> Lift f a -> b # foldr1 :: (a -> a -> a) -> Lift f a -> a # foldl1 :: (a -> a -> a) -> Lift f a -> a # elem :: Eq a => a -> Lift f a -> Bool # maximum :: Ord a => Lift f a -> a # minimum :: Ord a => Lift f a -> a # | |
Foldable1 f => Foldable1 (Lift f) Source # | |
Defined in Control.Applicative.Lift fold1 :: Semigroup m => Lift f m -> m # foldMap1 :: Semigroup m => (a -> m) -> Lift f a -> m # foldMap1' :: Semigroup m => (a -> m) -> Lift f a -> m # toNonEmpty :: Lift f a -> NonEmpty a # maximum :: Ord a => Lift f a -> a # minimum :: Ord a => Lift f a -> a # foldrMap1 :: (a -> b) -> (a -> b -> b) -> Lift f a -> b # foldlMap1' :: (a -> b) -> (b -> a -> b) -> Lift f a -> b # foldlMap1 :: (a -> b) -> (b -> a -> b) -> Lift f a -> b # foldrMap1' :: (a -> b) -> (a -> b -> b) -> Lift f a -> b # | |
Eq1 f => Eq1 (Lift f) Source # | |
Ord1 f => Ord1 (Lift f) Source # | |
Defined in Control.Applicative.Lift | |
Read1 f => Read1 (Lift f) Source # | |
Defined in Control.Applicative.Lift | |
Show1 f => Show1 (Lift f) Source # | |
Traversable f => Traversable (Lift f) Source # | |
Alternative f => Alternative (Lift f) Source # | A combination is |
Applicative f => Applicative (Lift f) Source # | A combination is |
Functor f => Functor (Lift f) Source # | |
Generic (Lift f a) Source # | |
(Read1 f, Read a) => Read (Lift f a) Source # | |
(Show1 f, Show a) => Show (Lift f a) Source # | |
(Eq1 f, Eq a) => Eq (Lift f a) Source # | |
(Ord1 f, Ord a) => Ord (Lift f a) Source # | |
Defined in Control.Applicative.Lift | |
type Rep1 (Lift f :: Type -> Type) Source # | |
Defined in Control.Applicative.Lift type Rep1 (Lift f :: Type -> Type) = D1 ('MetaData "Lift" "Control.Applicative.Lift" "transformers-0.6.1.2-KquO3qiMMr21gbsKwWKH4A" 'False) (C1 ('MetaCons "Pure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1) :+: C1 ('MetaCons "Other" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f))) | |
type Rep (Lift f a) Source # | |
Defined in Control.Applicative.Lift type Rep (Lift f a) = D1 ('MetaData "Lift" "Control.Applicative.Lift" "transformers-0.6.1.2-KquO3qiMMr21gbsKwWKH4A" 'False) (C1 ('MetaCons "Pure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Other" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)))) |
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.
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.