- io :: (Read a, Show a) => IO a -> CGI a
- feedback :: (CGIMonad cgi, Read a, Show a) => (a -> cgi a) -> a -> cgi a
- callWithCurrentHistory :: (CGIMonad cgi, Read a, Show a) => ((a -> cgi ()) -> a -> cgi ()) -> a -> cgi ()
- once :: (CGIMonad cgi, Read a, Show a) => cgi a -> cgi a
- forever :: CGIMonad cgi => cgi () -> cgi ()
- onceAndThen :: (CGIMonad cgi, Read a, Show a) => a -> cgi a -> cgi a
- unsafe_io :: IO a -> CGI a
- ask :: CGIMonad cgi => WithHTML x cgi a -> cgi ()
- askResumptive :: CGIMonad cgi => WithHTML x cgi a -> cgi ()
- askContinuously :: CGIMonad cgi => WithHTML x cgi a -> cgi ()
- askOffline :: CGIMonad cgi => WithHTML x cgi a -> (Element -> IO ()) -> cgi ()
- run :: CGI () -> IO ()
- runWithOptions :: CGIOptions -> CGI () -> IO ()
- runWithHook :: CGIOptions -> ([String] -> CGI ()) -> CGI () -> IO ()
- makeServlet :: CGI () -> CGIProgram
- makeServletWithHook :: ([String] -> CGI ()) -> CGI () -> CGIProgram
- tell :: (CGIMonad cgi, CGIOutput a) => a -> cgi ()
- tellContinuously :: (CGIMonad cgi, CGIOutput a) => a -> cgi ()
- rawTellContinuously :: CGIOutput a => a -> CGIAction ()
- htell :: CGIMonad cgi => WithHTML x IO () -> cgi a
- tellError :: String -> Element -> CGIAction a
- reportError :: String -> WithHTML x IO () -> CGIState -> IO (a, CGIState)
- backLink :: Monad m => HTMLCons x y m ()
- hlink :: Monad m => URL -> HTMLCons x y m ()
- frameTranslator :: CGIMonad cgi => ([String] -> cgi ()) -> [String] -> cgi ()
- docTranslator :: [FreeForm] -> ([String] -> CGI ()) -> [String] -> CGI ()
- lastTranslator :: [String] -> CGI ()
- subVar :: String
Documentation
callWithCurrentHistory :: (CGIMonad cgi, Read a, Show a) => ((a -> cgi ()) -> a -> cgi ()) -> a -> cgi ()Source
Control operator for the CGI
monad. Its specification is
callWithCurrentHistory (\backto x -> action x >>= backto) x == action x >>= callWithCurrentHistory (\backto x -> action x >>= backto)
However, callWithCurrentHistory
is more efficient because it avoids the
buildup of long interaction logs by cutting back every time just before
action
gets executed.
once :: (CGIMonad cgi, Read a, Show a) => cgi a -> cgi aSource
Brackets a CGI
action so that only its result is visible. Improves
efficiency by not executing the bracketed action after it has been performed
once. Use this for avoiding the inefficient buildup of long interaction logs.
forever :: CGIMonad cgi => cgi () -> cgi ()Source
Repeats a CGI
action without saving its state so that the size of the
interaction log remains constant.
onceAndThen :: (CGIMonad cgi, Read a, Show a) => a -> cgi a -> cgi aSource
Unsafe variant of once
: returns the computed value only the first time
and returns a default value in all later invocations.
[deprecated]
ask :: CGIMonad cgi => WithHTML x cgi a -> cgi ()Source
Takes a monadic value that constructs a HTML page and delivers this page to the browser. This page may contain forms and input widgets.
askResumptive :: CGIMonad cgi => WithHTML x cgi a -> cgi ()Source
Implementation of ask
for the pure logged variant.
askContinuously :: CGIMonad cgi => WithHTML x cgi a -> cgi ()Source
Experimental implementation of continuous version.
askOffline :: CGIMonad cgi => WithHTML x cgi a -> (Element -> IO ()) -> cgi ()Source
Like ask
, but passes the constructed HTML page to the elementAction
parameter. This function may send the page via Email or store it into a
file. Anyone loading this page in a browser can resume the interaction.
runWithOptions :: CGIOptions -> CGI () -> IO ()Source
runWithHook :: CGIOptions -> ([String] -> CGI ()) -> CGI () -> IO ()Source
Variant of run
where an additional argument cgigen
specifies an action
taken when the script is invoked with a non-empty query string as in
script-name?query-string
makeServlet :: CGI () -> CGIProgramSource
Transform a CGI action into a servlet suitable for running from Marlow's web server.
makeServletWithHook :: ([String] -> CGI ()) -> CGI () -> CGIProgramSource
Like makeServlet
with additional CGI generator as in runWithHook
.
tell :: (CGIMonad cgi, CGIOutput a) => a -> cgi ()Source
Terminates script by sending its argument to the browser.
tellContinuously :: (CGIMonad cgi, CGIOutput a) => a -> cgi ()Source
(experimental: continuous version) send argument to the browser.
rawTellContinuously :: CGIOutput a => a -> CGIAction ()Source
htell :: CGIMonad cgi => WithHTML x IO () -> cgi aSource
Terminate script by sending a HTML page constructed by monadic argument.
backLink :: Monad m => HTMLCons x y m ()Source
Link to previous page in browser's history. Uses JavaScript.
docTranslator :: [FreeForm] -> ([String] -> CGI ()) -> [String] -> CGI ()Source
A translator is a function [String] -> CGI ()
. It takes the query string
of the URL (of type [String]
) and translates it into a CGI
action. docTranslator docs next
takes a list of FreeForm
documents and a next translator. It tries to
select a document by its ffName
and falls through to the
next
translator if no document matches.
lastTranslator :: [String] -> CGI ()Source
Terminates a sequence of translators.