monads-tf-0.1.0.3: Monad classes, using type families

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.List

Description

The List monad.

Synopsis

- newtype ListT m a :: (* -> *) -> * -> * = ListT {
  - runListT :: m [a]
  }
- mapListT :: (m [a] -> n [b]) -> ListT m a -> ListT n b
- module Control.Monad
- module Control.Monad.Trans

# Documentation

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 |
Methods lift :: Monad m => m a -> ListT m a #
Monad m => Monad (ListT m) |
Methods (>>=) :: ListT m a -> (a -> ListT m b) -> ListT m b # (>>) :: ListT m a -> ListT m b -> ListT m b # return :: a -> ListT m a # fail :: String -> ListT m a #
Functor m => Functor (ListT m) |
Methods fmap :: (a -> b) -> ListT m a -> ListT m b # (<$) :: a -> ListT m b -> ListT m a #
Monad m => MonadFail (ListT m) |
Methods fail :: String -> ListT m a #
Applicative m => Applicative (ListT m) |
Methods pure :: a -> ListT m a # (<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b # (*>) :: ListT m a -> ListT m b -> ListT m b # (<*) :: ListT m a -> ListT m b -> ListT m a #
Foldable f => Foldable (ListT f) |
Methods fold :: Monoid m => ListT f m -> m # foldMap :: Monoid m => (a -> m) -> ListT f a -> m # foldr :: (a -> b -> b) -> b -> ListT f a -> b # foldr' :: (a -> b -> b) -> b -> ListT f a -> b # foldl :: (b -> a -> b) -> b -> ListT f a -> b # foldl' :: (b -> a -> b) -> b -> ListT f a -> b # foldr1 :: (a -> a -> a) -> ListT f a -> a # foldl1 :: (a -> a -> a) -> ListT f a -> a # toList :: ListT f a -> [a] # null :: ListT f a -> Bool # length :: ListT f a -> Int # elem :: Eq a => a -> ListT f a -> Bool # maximum :: Ord a => ListT f a -> a # minimum :: Ord a => ListT f a -> a # sum :: Num a => ListT f a -> a # product :: Num a => ListT f a -> a #
Traversable f => Traversable (ListT f) |
Methods traverse :: Applicative f => (a -> f b) -> ListT f a -> f (ListT f b) # sequenceA :: Applicative f => ListT f (f a) -> f (ListT f a) # mapM :: Monad m => (a -> m b) -> ListT f a -> m (ListT f b) # sequence :: Monad m => ListT f (m a) -> m (ListT f a) #
Eq1 m => Eq1 (ListT m) |
Methods liftEq :: (a -> b -> Bool) -> ListT m a -> ListT m b -> Bool #
Ord1 m => Ord1 (ListT m) |
Methods liftCompare :: (a -> b -> Ordering) -> ListT m a -> ListT m b -> Ordering #
Read1 m => Read1 (ListT m) |
Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (ListT m a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [ListT m a] #
Show1 m => Show1 (ListT m) |
Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ListT m a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ListT m a] -> ShowS #
MonadZip m => MonadZip (ListT m) |
Methods mzip :: ListT m a -> ListT m b -> ListT m (a, b) # mzipWith :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c # munzip :: ListT m (a, b) -> (ListT m a, ListT m b) #
MonadIO m => MonadIO (ListT m) |
Methods liftIO :: IO a -> ListT m a #
Applicative m => Alternative (ListT m) |
Methods empty :: ListT m a # (<|>) :: ListT m a -> ListT m a -> ListT m a # some :: ListT m a -> ListT m [a] # many :: ListT m a -> ListT m [a] #
Monad m => MonadPlus (ListT m) |
Methods mzero :: ListT m a # mplus :: ListT m a -> ListT m a -> ListT m a #
MonadCont m => MonadCont (ListT m) # |
Methods callCC :: ((a -> ListT m b) -> ListT m a) -> ListT m a #
MonadError m => MonadError (ListT m) # |
Associated Types type ErrorType (ListT m :: * -> *) :: * # Methods throwError :: ErrorType (ListT m) -> ListT m a # catchError :: ListT m a -> (ErrorType (ListT m) -> ListT m a) -> ListT m a #
MonadReader m => MonadReader (ListT m) # |
Associated Types type EnvType (ListT m :: * -> *) :: * # Methods ask :: ListT m (EnvType (ListT m)) # local :: (EnvType (ListT m) -> EnvType (ListT m)) -> ListT m a -> ListT m a #
MonadState m => MonadState (ListT m) # |
Associated Types type StateType (ListT m :: * -> *) :: * # Methods get :: ListT m (StateType (ListT m)) # put :: StateType (ListT m) -> ListT m () #
(Eq1 m, Eq a) => Eq (ListT m a) |
Methods (==) :: ListT m a -> ListT m a -> Bool # (/=) :: ListT m a -> ListT m a -> Bool #
(Ord1 m, Ord a) => Ord (ListT m a) |
Methods compare :: ListT m a -> ListT m a -> Ordering # (<) :: ListT m a -> ListT m a -> Bool # (<=) :: ListT m a -> ListT m a -> Bool # (>) :: ListT m a -> ListT m a -> Bool # (>=) :: ListT m a -> ListT m a -> Bool # max :: ListT m a -> ListT m a -> ListT m a # min :: ListT m a -> ListT m a -> ListT m a #
(Read1 m, Read a) => Read (ListT m a) |
Methods readsPrec :: Int -> ReadS (ListT m a) # readList :: ReadS [ListT m a] # readPrec :: ReadPrec (ListT m a) # readListPrec :: ReadPrec [ListT m a] #
(Show1 m, Show a) => Show (ListT m a) |
Methods showsPrec :: Int -> ListT m a -> ShowS # show :: ListT m a -> String # showList :: [ListT m a] -> ShowS #
type ErrorType (ListT m) # |
type ErrorType (ListT m) = ErrorType m
type EnvType (ListT m) # |
type EnvType (ListT m) = EnvType m
type StateType (ListT m) # |
type StateType (ListT m) = StateType m

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

Map between `ListT` computations.

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

module Control.Monad

module Control.Monad.Trans