monadLib-3.9: A collection of monad transformers.

Safe HaskellSafe
LanguageHaskell98

MonadLib.Monads

Description

This module contains a collection of monads that are defined in terms of the monad transformers from MonadLib. The definitions in this module are completely mechanical and so this module may become obsolete if support for automated derivations for instances becomes well supported across implementations.

Documentation

data Reader i a Source #

Instances
Monad (Reader i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

(>>=) :: Reader i a -> (a -> Reader i b) -> Reader i b #

(>>) :: Reader i a -> Reader i b -> Reader i b #

return :: a -> Reader i a #

fail :: String -> Reader i a #

Functor (Reader i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

fmap :: (a -> b) -> Reader i a -> Reader i b #

(<$) :: a -> Reader i b -> Reader i a #

MonadFix (Reader i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

mfix :: (a -> Reader i a) -> Reader i a #

Applicative (Reader i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

pure :: a -> Reader i a #

(<*>) :: Reader i (a -> b) -> Reader i a -> Reader i b #

liftA2 :: (a -> b -> c) -> Reader i a -> Reader i b -> Reader i c #

(*>) :: Reader i a -> Reader i b -> Reader i b #

(<*) :: Reader i a -> Reader i b -> Reader i a #

RunReaderM (Reader i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

local :: i -> Reader i a -> Reader i a Source #

ReaderM (Reader i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

ask :: Reader i i Source #

BaseM (Reader i) (Reader i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

inBase :: Reader i a -> Reader i a Source #

data Writer i a Source #

Instances
Monoid i => Monad (Writer i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

(>>=) :: Writer i a -> (a -> Writer i b) -> Writer i b #

(>>) :: Writer i a -> Writer i b -> Writer i b #

return :: a -> Writer i a #

fail :: String -> Writer i a #

Monoid i => Functor (Writer i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

fmap :: (a -> b) -> Writer i a -> Writer i b #

(<$) :: a -> Writer i b -> Writer i a #

Monoid i => MonadFix (Writer i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

mfix :: (a -> Writer i a) -> Writer i a #

Monoid i => Applicative (Writer i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

pure :: a -> Writer i a #

(<*>) :: Writer i (a -> b) -> Writer i a -> Writer i b #

liftA2 :: (a -> b -> c) -> Writer i a -> Writer i b -> Writer i c #

(*>) :: Writer i a -> Writer i b -> Writer i b #

(<*) :: Writer i a -> Writer i b -> Writer i a #

Monoid i => RunWriterM (Writer i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

collect :: Writer i a -> Writer i (a, i) Source #

Monoid i => WriterM (Writer i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

put :: i -> Writer i () Source #

Monoid i => BaseM (Writer i) (Writer i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

inBase :: Writer i a -> Writer i a Source #

data State i a Source #

Instances
Monad (State i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

(>>=) :: State i a -> (a -> State i b) -> State i b #

(>>) :: State i a -> State i b -> State i b #

return :: a -> State i a #

fail :: String -> State i a #

Functor (State i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

fmap :: (a -> b) -> State i a -> State i b #

(<$) :: a -> State i b -> State i a #

MonadFix (State i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

mfix :: (a -> State i a) -> State i a #

Applicative (State i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

pure :: a -> State i a #

(<*>) :: State i (a -> b) -> State i a -> State i b #

liftA2 :: (a -> b -> c) -> State i a -> State i b -> State i c #

(*>) :: State i a -> State i b -> State i b #

(<*) :: State i a -> State i b -> State i a #

StateM (State i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

get :: State i i Source #

set :: i -> State i () Source #

BaseM (State i) (State i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

inBase :: State i a -> State i a Source #

data Exception i a Source #

Instances
Monad (Exception i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

(>>=) :: Exception i a -> (a -> Exception i b) -> Exception i b #

(>>) :: Exception i a -> Exception i b -> Exception i b #

return :: a -> Exception i a #

fail :: String -> Exception i a #

Functor (Exception i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

fmap :: (a -> b) -> Exception i a -> Exception i b #

(<$) :: a -> Exception i b -> Exception i a #

MonadFix (Exception i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

mfix :: (a -> Exception i a) -> Exception i a #

Applicative (Exception i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

pure :: a -> Exception i a #

(<*>) :: Exception i (a -> b) -> Exception i a -> Exception i b #

liftA2 :: (a -> b -> c) -> Exception i a -> Exception i b -> Exception i c #

(*>) :: Exception i a -> Exception i b -> Exception i b #

(<*) :: Exception i a -> Exception i b -> Exception i a #

RunExceptionM (Exception i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

try :: Exception i a -> Exception i (Either i a) Source #

ExceptionM (Exception i) i Source # 
Instance details

Defined in MonadLib.Monads

Methods

raise :: i -> Exception i a Source #

BaseM (Exception i) (Exception i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

inBase :: Exception i a -> Exception i a Source #

data Cont i a Source #

Instances
Monad (Cont i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

(>>=) :: Cont i a -> (a -> Cont i b) -> Cont i b #

(>>) :: Cont i a -> Cont i b -> Cont i b #

return :: a -> Cont i a #

fail :: String -> Cont i a #

Functor (Cont i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

fmap :: (a -> b) -> Cont i a -> Cont i b #

(<$) :: a -> Cont i b -> Cont i a #

Applicative (Cont i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

pure :: a -> Cont i a #

(<*>) :: Cont i (a -> b) -> Cont i a -> Cont i b #

liftA2 :: (a -> b -> c) -> Cont i a -> Cont i b -> Cont i c #

(*>) :: Cont i a -> Cont i b -> Cont i b #

(<*) :: Cont i a -> Cont i b -> Cont i a #

ContM (Cont i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

callWithCC :: ((a -> Label (Cont i)) -> Cont i a) -> Cont i a Source #

BaseM (Cont i) (Cont i) Source # 
Instance details

Defined in MonadLib.Monads

Methods

inBase :: Cont i a -> Cont i a Source #

runReader :: i -> Reader i a -> a Source #

runWriter :: Writer i a -> (a, i) Source #

runState :: i -> State i a -> (a, i) Source #

runCont :: (a -> i) -> Cont i a -> i Source #

module MonadLib