Control.Monad.Trans.List

transformers-0.4.2.0: Concrete functor and monad transformers

Copyright | (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001
License | BSD-style (see the file LICENSE)
Maintainer | ross@soi.city.ac.uk
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Control.Monad.Trans.List

Contents

- The ListT monad transformer
- Lifting other operations

Description

The ListT monad transformer, adding backtracking to a given monad, which must be commutative.

Synopsis

- newtype ListT m a = ListT {
  - runListT :: m [a]
  }
- mapListT :: (m [a] -> n [b]) -> ListT m a -> ListT n b
- liftCallCC :: CallCC m [a] [b] -> CallCC (ListT m) a b
- liftCatch :: Catch e m [a] -> Catch e (ListT m) a

# The ListT monad transformer

newtype ListT m a

Parameterizable list monad, with an inner monad.

Note: this does not yield a monad unless the argument monad is commutative.

Constructors

ListT |
Fields runListT :: m [a]

Instances

MonadTrans ListT |
Monad m => Monad (ListT m) |
Functor m => Functor (ListT m) |
Applicative m => Applicative (ListT m) |
Foldable f => Foldable (ListT f) |
Traversable f => Traversable (ListT f) |
Applicative m => Alternative (ListT m) |
Monad m => MonadPlus (ListT m) |
MonadIO m => MonadIO (ListT m) |
Show1 m => Show1 (ListT m) |
Read1 m => Read1 (ListT m) |
Ord1 m => Ord1 (ListT m) |
Eq1 m => Eq1 (ListT m) |
(Eq1 m, Eq a) => Eq (ListT m a) |
(Ord1 m, Ord a) => Ord (ListT m a) |
(Read1 m, Read a) => Read (ListT m a) |
(Show1 m, Show a) => Show (ListT m a) |

mapListT :: (m [a] -> n [b]) -> ListT m a -> ListT n b

Map between `ListT` computations.

-     runListT (mapListT f m) = f (runListT m)

# Lifting other operations

liftCallCC :: CallCC m [a] [b] -> CallCC (ListT m) a b

Lift a `callCC` operation to the new monad.

liftCatch :: Catch e m [a] -> Catch e (ListT m) a

Lift a `catchE` operation to the new monad.