monads-tf-0.0.0.1: Monad classes, using type familiesSource codeContentsIndex
Control.Monad.RWS.Lazy
Portabilitynon-portable (type families)
Stabilityexperimental
Maintainerlibraries@haskell.org
Contents
The RWS monad
The RWST monad transformer
Lazy Reader-writer-state monads
Description

Lazy RWS monad.

Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/) Advanced School of Functional Programming, 1995.

Synopsis
type RWS r w s = RWST r w s Identity
runRWS :: RWS r w s a -> r -> s -> (a, s, w)
evalRWS :: RWS r w s a -> r -> s -> (a, w)
execRWS :: RWS r w s a -> r -> s -> (s, w)
mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b
withRWS :: (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s a
newtype RWST r w s m a = RWST {
runRWST :: r -> s -> m (a, s, w)
}
evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)
execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)
mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b
withRWST :: (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m a
module Control.Monad.RWS.Class
module Control.Monad
module Control.Monad.Fix
module Control.Monad.Trans
module Data.Monoid
The RWS monad
type RWS r w s = RWST r w s IdentitySource
runRWS :: RWS r w s a -> r -> s -> (a, s, w)Source
evalRWS :: RWS r w s a -> r -> s -> (a, w)Source
execRWS :: RWS r w s a -> r -> s -> (s, w)Source
mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s bSource
withRWS :: (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s aSource
The RWST monad transformer
newtype RWST r w s m a Source
Constructors
RWST
runRWST :: r -> s -> m (a, s, w)
show/hide Instances
Monoid w => MonadTrans (RWST r w s)
(Monoid w, Monad m) => Monad (RWST r w s m)
Functor m => Functor (RWST r w s m)
(Monoid w, MonadFix m) => MonadFix (RWST r w s m)
(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m)
(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m)
(Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m)
(Monoid w, MonadIO m) => MonadIO (RWST r w s m)
(Monoid w, Monad m) => MonadWriter (RWST r w s m)
(Monad m, Monoid w) => MonadState (RWST r w s m)
(Monoid w, Monad m) => MonadReader (RWST r w s m)
(Monoid w, Monad m) => MonadRWS (RWST r w s m)
(Monoid w, MonadError m) => MonadError (RWST r w s m)
(Monoid w, MonadCont m) => MonadCont (RWST r w s m)
evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)Source
execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)Source
mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n bSource
withRWST :: (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m aSource
Lazy Reader-writer-state monads
module Control.Monad.RWS.Class
module Control.Monad
module Control.Monad.Fix
module Control.Monad.Trans
module Data.Monoid
Produced by Haddock version 2.6.0