-- 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.5.19 -- | 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 -> ByteString -> HackErrors -> [(String, String)] -> Env -- | HTTP request method requestMethod :: 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. scriptName :: 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 "/" pathInfo :: Env -> String -- | The portion of the request URL that follows the ?, if any. May be -- empty queryString :: 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 serverName :: 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. serverPort :: Env -> Int -- | All http header variables. http :: Env -> [(String, String)] -- | The Array [0,1], representing this version of Hack hackVersion :: Env -> [Int] -- | HTTP or HTTPS, depending on the request URL hackUrlScheme :: Env -> Hack_UrlScheme -- | body of the request hackInput :: Env -> ByteString -- | error stream hackErrors :: Env -> HackErrors -- | custom headers, intended to be used by middleware hackHeaders :: Env -> [(String, String)] data Response Response :: Int -> [(String, String)] -> ByteString -> 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 -> ByteString 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