ContentsIndex
CGIMonad
Description
Definition of the monad underlying the CGI library.
Synopsis
newtype CGI a = CGI {
unCGI :: (CGIAction a)
}
type CGIAction a = CGIState -> IO (a, CGIState)
data CGIState = CGIState {
inparm :: [PARAMETER]
outparm :: [PARAMETER]
stateID :: String
mcount :: Int
cgiInfo :: CGIInfo
pageInfo :: PageInfo
encoder :: (String -> String)
cookieMap :: [(String, (Maybe String, Maybe String))]
cookiesToSend :: [String]
}
data PageInfo = PageInfo {
count :: Int
nextaction :: (Element -> CGIAction ())
actionTable :: [(String, Element -> CGIAction ())]
bindings :: (Maybe CGIParameters)
enctype :: String
inFrame :: Int
allFields :: [(String, Bool)]
faultyfields :: [(String, String)]
}
data CGIFieldName = CGIFieldName {
fnMcount :: Int
fnCount :: Int
}
wrapIO :: IO a -> CGIAction a
lift :: IO a -> CGI a
setAction :: (Element -> CGI ()) -> CGI ()
registerAction :: String -> (Element -> CGI ()) -> CGI ()
incFrame :: CGI Int
resetFrame :: CGI ()
setEnctype :: String -> CGI ()
setFaulty :: [(String, String)] -> CGI ()
data PARAMETER
= PAR_RESULT String
| PAR_VALUES CGIParameters
| PAR_MARK String
| PAR_IGNORED
nextName :: CGI CGIFieldName
addField :: String -> Bool -> CGI ()
Documentation
newtype CGI a
Constructors
CGI
unCGI :: (CGIAction a)
Instances
Monad CGI
type CGIAction a = CGIState -> IO (a, CGIState)
data CGIState
Constructors
CGIState
inparm :: [PARAMETER]
outparm :: [PARAMETER]
stateID :: String
mcount :: Int
cgiInfo :: CGIInfo
pageInfo :: PageInfo
encoder :: (String -> String)
cookieMap :: [(String, (Maybe String, Maybe String))]
cookiesToSend :: [String]
data PageInfo
Constructors
PageInfo
count :: Int
nextaction :: (Element -> CGIAction ())
actionTable :: [(String, Element -> CGIAction ())]
bindings :: (Maybe CGIParameters)
enctype :: String
inFrame :: Int
allFields :: [(String, Bool)]
faultyfields :: [(String, String)]
data CGIFieldName
Constructors
CGIFieldName
fnMcount :: Int
fnCount :: Int
Instances
Show CGIFieldName
wrapIO :: IO a -> CGIAction a
wrapper to transform IO computation to CGIAction
lift :: IO a -> CGI a
lift IO monad to CGI monad
setAction :: (Element -> CGI ()) -> CGI ()
registerAction :: String -> (Element -> CGI ()) -> CGI ()
incFrame :: CGI Int
resetFrame :: CGI ()
setEnctype :: String -> CGI ()
setFaulty :: [(String, String)] -> CGI ()
data PARAMETER
Constructors
PAR_RESULT Stringresult of an IO operation shown as a string
PAR_VALUES CGIParametersrecord of a form input
PAR_MARK Stringrecorded stateID before the mark
PAR_IGNORED
Instances
Show PARAMETER
Read PARAMETER
nextName :: CGI CGIFieldName
addField :: String -> Bool -> CGI ()
Produced by Haddock version 0.6