W3cubDocs

/Haskell 8

Control.Monad.List

Copyright (c) Andy Gill 2001
(c) Oregon Graduate Institute of Science and Technology 2001
License BSD-style (see the file LICENSE)
Maintainer [email protected]
Stability experimental
Portability portable
Safe Haskell Safe
Language Haskell2010

Description

The List monad.

newtype ListT (m :: Type -> Type) a Source

Parameterizable list monad, with an inner monad.

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

Constructors

ListT

Fields

Instances
Instances details
MonadTrans ListT
Instance details

Defined in Control.Monad.Trans.List

Methods

lift :: Monad m => m a -> ListT m a Source

MonadError e m => MonadError e (ListT m)
Instance details

Defined in Control.Monad.Error.Class

Methods

throwError :: e -> ListT m a Source

catchError :: ListT m a -> (e -> ListT m a) -> ListT m a Source

MonadReader r m => MonadReader r (ListT m)
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ListT m r Source

local :: (r -> r) -> ListT m a -> ListT m a Source

reader :: (r -> a) -> ListT m a Source

MonadState s m => MonadState s (ListT m)
Instance details

Defined in Control.Monad.State.Class

Methods

get :: ListT m s Source

put :: s -> ListT m () Source

state :: (s -> (a, s)) -> ListT m a Source

Monad m => Monad (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

(>>=) :: ListT m a -> (a -> ListT m b) -> ListT m b Source

(>>) :: ListT m a -> ListT m b -> ListT m b Source

return :: a -> ListT m a Source

Functor m => Functor (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

fmap :: (a -> b) -> ListT m a -> ListT m b Source

(<$) :: a -> ListT m b -> ListT m a Source

MonadFix m => MonadFix (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

mfix :: (a -> ListT m a) -> ListT m a Source

Monad m => MonadFail (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

fail :: String -> ListT m a Source

Applicative m => Applicative (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

pure :: a -> ListT m a Source

(<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b Source

liftA2 :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c Source

(*>) :: ListT m a -> ListT m b -> ListT m b Source

(<*) :: ListT m a -> ListT m b -> ListT m a Source

Foldable f => Foldable (ListT f)
Instance details

Defined in Control.Monad.Trans.List

Methods

fold :: Monoid m => ListT f m -> m Source

foldMap :: Monoid m => (a -> m) -> ListT f a -> m Source

foldMap' :: Monoid m => (a -> m) -> ListT f a -> m Source

foldr :: (a -> b -> b) -> b -> ListT f a -> b Source

foldr' :: (a -> b -> b) -> b -> ListT f a -> b Source

foldl :: (b -> a -> b) -> b -> ListT f a -> b Source

foldl' :: (b -> a -> b) -> b -> ListT f a -> b Source

foldr1 :: (a -> a -> a) -> ListT f a -> a Source

foldl1 :: (a -> a -> a) -> ListT f a -> a Source

toList :: ListT f a -> [a] Source

null :: ListT f a -> Bool Source

length :: ListT f a -> Int Source

elem :: Eq a => a -> ListT f a -> Bool Source

maximum :: Ord a => ListT f a -> a Source

minimum :: Ord a => ListT f a -> a Source

sum :: Num a => ListT f a -> a Source

product :: Num a => ListT f a -> a Source

Traversable f => Traversable (ListT f)
Instance details

Defined in Control.Monad.Trans.List

Methods

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

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

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

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

Contravariant m => Contravariant (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

contramap :: (a -> b) -> ListT m b -> ListT m a Source

(>$) :: b -> ListT m b -> ListT m a Source

Eq1 m => Eq1 (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

liftEq :: (a -> b -> Bool) -> ListT m a -> ListT m b -> Bool Source

Ord1 m => Ord1 (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

liftCompare :: (a -> b -> Ordering) -> ListT m a -> ListT m b -> Ordering Source

Read1 m => Read1 (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (ListT m a) Source

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [ListT m a] Source

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (ListT m a) Source

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [ListT m a] Source

Show1 m => Show1 (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ListT m a -> ShowS Source

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ListT m a] -> ShowS Source

MonadZip m => MonadZip (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

mzip :: ListT m a -> ListT m b -> ListT m (a, b) Source

mzipWith :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c Source

munzip :: ListT m (a, b) -> (ListT m a, ListT m b) Source

MonadIO m => MonadIO (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

liftIO :: IO a -> ListT m a Source

Applicative m => Alternative (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

empty :: ListT m a Source

(<|>) :: ListT m a -> ListT m a -> ListT m a Source

some :: ListT m a -> ListT m [a] Source

many :: ListT m a -> ListT m [a] Source

Monad m => MonadPlus (ListT m)
Instance details

Defined in Control.Monad.Trans.List

Methods

mzero :: ListT m a Source

mplus :: ListT m a -> ListT m a -> ListT m a Source

MonadCont m => MonadCont (ListT m)
Instance details

Defined in Control.Monad.Cont.Class

Methods

callCC :: ((a -> ListT m b) -> ListT m a) -> ListT m a Source

(Eq1 m, Eq a) => Eq (ListT m a)
Instance details

Defined in Control.Monad.Trans.List

Methods

(==) :: ListT m a -> ListT m a -> Bool

(/=) :: ListT m a -> ListT m a -> Bool

(Ord1 m, Ord a) => Ord (ListT m a)
Instance details

Defined in Control.Monad.Trans.List

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)
Instance details

Defined in Control.Monad.Trans.List

(Show1 m, Show a) => Show (ListT m a)
Instance details

Defined in Control.Monad.Trans.List

Methods

showsPrec :: Int -> ListT m a -> ShowS Source

show :: ListT m a -> String Source

showList :: [ListT m a] -> ShowS Source

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

Map between ListT computations.

module Control.Monad

module Control.Monad.Trans

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.8.3/docs/html/libraries/mtl-2.2.2/Control-Monad-List.html