-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | a sexy Haskell Webserver Interface -- -- Hack: a sexy Haskell Webserver Interface. Hack is a brain-dead port of -- the brilliant Ruby Rack http://rack.rubyforge.org/ webserver -- interface. @package hack @version 2009.4.52 -- | Hack spec! Stolen from Rack with some simplification. module Hack version :: [Int] data RequestMethod OPTIONS :: RequestMethod GET :: RequestMethod HEAD :: RequestMethod POST :: RequestMethod PUT :: RequestMethod DELETE :: RequestMethod TRACE :: RequestMethod CONNECT :: RequestMethod data Hack_UrlScheme HTTP :: Hack_UrlScheme HTTPS :: Hack_UrlScheme -- | customizable error stream type HackErrors = String -> IO () data Env Env :: RequestMethod -> String -> String -> String -> String -> Int -> [(String, String)] -> [Int] -> Hack_UrlScheme -> String -> HackErrors -> Bool -> Bool -> Bool -> [(String, String)] -> Env -- | HTTP request method request_method :: Env -> RequestMethod -- | The initial portion of the request URL's "path" that corresponds to -- the application object, so that the application knows its virtual -- "location". This may be an empty string, if the application -- corresponds to the "root" of the server. script_name :: Env -> String -- | The remainder of the request URL's "path", designating the virtual -- "location" of the request's target within the application. This will -- always starts with "/" path_info :: Env -> String -- | The portion of the request URL that follows the ?, if any. May be -- empty query_string :: Env -> String -- | When combined with SCRIPT_NAME and PATH_INFO, these variables can be -- used to complete the URL. Note, however, that HTTP_HOST, if present, -- should be used server_name :: Env -> String -- | preference to SERVER_NAME for reconstructing the request URL. -- SERVER_NAME and SERVER_PORT can never be empty strings, and so are -- always required. server_port :: Env -> Int -- | Variables corresponding to the client-supplied HTTP request headers http :: Env -> [(String, String)] -- | The Array [0,1], representing this version of Hack hack_version :: Env -> [Int] -- | HTTP or HTTPS, depending on the request URL hack_url_scheme :: Env -> Hack_UrlScheme -- | body of the request hack_input :: Env -> String -- | error stream hack_errors :: Env -> HackErrors -- | true if the application object may be simultaneously invoked by -- another thread in the same process, false otherwise. hack_multithread :: Env -> Bool -- | true if an equivalent application object may be simultaneously invoked -- by another process, false otherwise. hack_multiprocess :: Env -> Bool -- | true if the server expects (but does not guarantee!) that the -- application will only be invoked this one time during the life of its -- containing process. Normally, this will only be true for a server -- based on CGI (or something similar). hack_run_once :: Env -> Bool -- | any non HTTP standard header custom :: Env -> [(String, String)] data Response Response :: Int -> [(String, String)] -> String -> Response -- | must be greater than or equal to 100. status :: Response -> Int -- | The header must not contain a Status key, contain keys with : or -- newlines in their name, contain keys names that end in - or _, but -- only contain keys that consist of letters, digits, _ or - and start -- with a letter. The values of the header must be Strings, consisting of -- lines (for multiple header values) seperated by "\n". The lines must -- not contain characters below 037. headers :: Response -> [(String, String)] -- | body of the response body :: Response -> String type Application = Env -> IO Response type Middleware = Application -> Application instance Show Response instance Show Env instance Show Hack_UrlScheme instance Eq Hack_UrlScheme instance Show RequestMethod instance Read RequestMethod instance Eq RequestMethod instance Default Env instance Default Response instance Default Hack_UrlScheme instance Default RequestMethod instance Show HackErrors