monadLib-3.7.3: A collection of monad transformers.

Safe Haskell | Safe
Language | Haskell98

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 # |
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 # |
Methods fmap :: (a -> b) -> Reader i a -> Reader i b # (<$) :: a -> Reader i b -> Reader i a #
MonadFix (Reader i) Source # |
Methods mfix :: (a -> Reader i a) -> Reader i a #
Applicative (Reader i) Source # |
Methods pure :: a -> Reader i a # (<*>) :: Reader i (a -> b) -> Reader i a -> Reader i b # (*>) :: Reader i a -> Reader i b -> Reader i b # (<*) :: Reader i a -> Reader i b -> Reader i a #
RunReaderM (Reader i) i Source # |
Methods local :: i -> Reader i a -> Reader i a Source #
ReaderM (Reader i) i Source # |
Methods ask :: Reader i i Source #
BaseM (Reader i) (Reader i) Source # |
Methods inBase :: Reader i a -> Reader i a Source #

data Writer i a Source #

Instances

Monoid i => Monad (Writer i) Source # |
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 # |
Methods fmap :: (a -> b) -> Writer i a -> Writer i b # (<$) :: a -> Writer i b -> Writer i a #
Monoid i => MonadFix (Writer i) Source # |
Methods mfix :: (a -> Writer i a) -> Writer i a #
Monoid i => Applicative (Writer i) Source # |
Methods pure :: a -> Writer i a # (<*>) :: Writer i (a -> b) -> Writer i a -> Writer i b # (*>) :: 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 # |
Methods collect :: Writer i a -> Writer i (a, i) Source #
Monoid i => WriterM (Writer i) i Source # |
Methods put :: i -> Writer i () Source #
Monoid i => BaseM (Writer i) (Writer i) Source # |
Methods inBase :: Writer i a -> Writer i a Source #

data State i a Source #

Instances

Monad (State i) Source # |
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 # |
Methods fmap :: (a -> b) -> State i a -> State i b # (<$) :: a -> State i b -> State i a #
MonadFix (State i) Source # |
Methods mfix :: (a -> State i a) -> State i a #
Applicative (State i) Source # |
Methods pure :: a -> State i a # (<*>) :: State i (a -> b) -> State i a -> State i b # (*>) :: State i a -> State i b -> State i b # (<*) :: State i a -> State i b -> State i a #
StateM (State i) i Source # |
Methods get :: State i i Source # set :: i -> State i () Source #
BaseM (State i) (State i) Source # |
Methods inBase :: State i a -> State i a Source #

data Exception i a Source #

Instances

Monad (Exception i) Source # |
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 # |
Methods fmap :: (a -> b) -> Exception i a -> Exception i b # (<$) :: a -> Exception i b -> Exception i a #
MonadFix (Exception i) Source # |
Methods mfix :: (a -> Exception i a) -> Exception i a #
Applicative (Exception i) Source # |
Methods pure :: a -> Exception i a # (<*>) :: Exception i (a -> b) -> Exception i a -> Exception i b # (*>) :: Exception i a -> Exception i b -> Exception i b # (<*) :: Exception i a -> Exception i b -> Exception i a #
RunExceptionM (Exception i) i Source # |
Methods try :: Exception i a -> Exception i (Either i a) Source #
ExceptionM (Exception i) i Source # |
Methods raise :: i -> Exception i a Source #
BaseM (Exception i) (Exception i) Source # |
Methods inBase :: Exception i a -> Exception i a Source #

data Cont i a Source #

Instances

Monad (Cont i) Source # |
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 # |
Methods fmap :: (a -> b) -> Cont i a -> Cont i b # (<$) :: a -> Cont i b -> Cont i a #
Applicative (Cont i) Source # |
Methods pure :: a -> Cont i a # (<*>) :: Cont i (a -> b) -> Cont i a -> Cont i b # (*>) :: Cont i a -> Cont i b -> Cont i b # (<*) :: Cont i a -> Cont i b -> Cont i a #
ContM (Cont i) Source # |
Methods callWithCC :: ((a -> Label (Cont i)) -> Cont i a) -> Cont i a Source #
BaseM (Cont i) (Cont i) Source # |
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 #

runException :: Exception i a -> Either i a Source #

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

module MonadLib