hsp-0.7.1: Haskell Server Pages is a library for writing dynamic server-side web pages.

Portabilityrequires undecidable and overlapping instances, and forall in datatypes
Stabilityexperimental
MaintainerNiklas Broberg, nibro@cs.chalmers.se
Safe HaskellNone

HSP.Monad

Contents

Description

Datatypes and type classes comprising the basic model behind the scenes of Haskell Server Pages tags.

Synopsis

The HSP Monad

type HSP = HSPT IOSource

The HSP monad is a reader wrapper around the IO monad, but extended with an XMLGenerator wrapper. type HSP' = ReaderT HSPEnv IO type HSP = XMLGenT HSP'

type HSPT m = XMLGenT (HSPT' m)Source

runHSP :: Maybe XMLMetaData -> HSP a -> HSPEnv -> IO (Maybe XMLMetaData, a)Source

Runs a HSP computation in a particular environment. Since HSP wraps the IO monad, the result of running it will be an IO computation.

getEnv :: HSP HSPEnvSource

Supplies the HSP environment.

unsafeRunHSP :: HSP a -> IO (Maybe XMLMetaData, a)Source

Runs a HSP computation without an environment. Will work if the page in question does not touch the environment. Not sure about the usefulness at this stage though...

Functions

doIO :: IO a -> HSP aSource

Execute an IO computation within the HSP monad.

catch :: HSP a -> (Exception -> HSP a) -> HSP aSource

Catch a user-caused exception.