hxt-7.4: A collection of tools for processing XML with Haskell.Source codeContentsIndex
Control.Monad.MonadStateIO
Description

general usefull state monad for a local state and IO

Version : $Id: MonadStateIO.hs,v 1.1 20040902 19:11:55 hxml Exp $

Synopsis
newtype StateIO state res = STIO {
trans :: state -> IO (res, state)
}
io :: IO a -> StateIO state a
trcState :: (state -> String) -> StateIO state ()
changeState :: (state -> state) -> StateIO state state
setState :: state -> StateIO state state
getState :: StateIO state state
run :: state -> StateIO state res -> IO res
Documentation
newtype StateIO state res Source
Constructors
STIO
trans :: state -> IO (res, state)
show/hide Instances
Monad (StateIO state)
io :: IO a -> StateIO state aSource
lift IO command to StateIO
trcState :: (state -> String) -> StateIO state ()Source
state inspection command: a "show"-like function is applied to the state and the result is written to stderr.
changeState :: (state -> state) -> StateIO state stateSource
change the state with a given function and return the new state
setState :: state -> StateIO state stateSource
set the state
getState :: StateIO state stateSource
read the state
run :: state -> StateIO state res -> IO resSource
run a StateIO command with an initial state
Produced by Haddock version 2.3.0