-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Hack contrib -- -- Hack contrib @package hack-contrib @version 2009.4.52 -- | print the env and response in the console module Hack.Contrib.Middleware.Inspect inspect :: Middleware -- | Stolen from rack-contrib: modifies the environment using the block -- given during initialization. module Hack.Contrib.Middleware.Config config :: (Env -> Env) -> Middleware module Hack.Contrib.Middleware.Mime lookup_mime_type :: String -> Maybe String mime_types :: Map String String module Hack.Contrib.Constants status_with_no_entity_body :: [Int] _CacheControl :: String _Connection :: String _Date :: String _Pragma :: String _TransferEncoding :: String _Upgrade :: String _Via :: String _Accept :: String _AcceptCharset :: String _AcceptEncoding :: String _AcceptLanguage :: String _Authorization :: String _Cookie :: String _Expect :: String _From :: String _Host :: String _IfModifiedSince :: String _IfMatch :: String _IfNoneMatch :: String _IfRange :: String _IfUnmodifiedSince :: String _MaxForwards :: String _ProxyAuthorization :: String _Range :: String _Referer :: String _UserAgent :: String _Age :: String _Location :: String _ProxyAuthenticate :: String _Public :: String _RetryAfter :: String _Server :: String _SetCookie :: String _TE :: String _Trailer :: String _Vary :: String _Warning :: String _WWWAuthenticate :: String _Allow :: String _ContentBase :: String _ContentEncoding :: String _ContentLanguage :: String _ContentLength :: String _ContentLocation :: String _ContentMD5 :: String _ContentRange :: String _ContentType :: String _ETag :: String _Expires :: String _LastModified :: String _ContentTransferEncoding :: String _TextPlain :: String _TextHtml :: String _TextPlainUTF8 :: String _TextHtmlUTF8 :: String status_code :: Map Int String module Hack.Contrib.Utils type UnicodeString = String (>) :: (Category cat) => cat a b -> cat b c -> cat a c (+) :: (MonadPlus m) => m a -> m a -> m a (/) :: FilePath -> FilePath -> FilePath empty_app :: Application -- | usage: app.use [content_type, cache] use :: [Middleware] -> Middleware put :: String -> String -> [(String, String)] -> [(String, String)] get :: String -> [(String, String)] -> Maybe String -- | note when calling bytesize, you are sure that the string is in [char8] -- format anyway. so just call length bytesize :: String -> Int dummy_middleware :: Middleware dummy_app :: Application escape_html :: String -> String escape_uri :: String -> String unescape_uri :: String -> String show_status_message :: Int -> Maybe String httpdate :: UTCTime -> String url2unicode :: String -> String just_lookup :: (Ord k) => k -> Map k a -> a module Hack.Contrib.Request body :: Env -> String scheme :: Env -> String port :: Env -> Int path :: Env -> String content_type :: Env -> String media_type :: Env -> String media_type_params :: Env -> [(String, String)] content_charset :: Env -> String host :: Env -> String params :: Env -> [(String, String)] inputs :: Env -> [(String, String)] referer :: Env -> String cookies :: Env -> [(String, String)] fullpath :: Env -> String http_ :: String -> Env -> Maybe String custom_ :: String -> Env -> Maybe String url :: Env -> String module Hack.Contrib.Response redirect :: String -> Maybe Int -> Response -> Response finish :: Response -> Response header :: String -> Response -> Maybe String has_header :: String -> Response -> Bool set_header :: String -> String -> Response -> Response delete_header :: String -> Response -> Response set_content_type :: String -> Response -> Response set_content_length :: Int -> Response -> Response set_body :: String -> Response -> Response set_status :: Int -> Response -> Response set_last_modified :: String -> Response -> Response -- | Stolen from rack: Sets the Content-Type header on responses which -- don't have one. module Hack.Contrib.Middleware.ContentType content_type :: String -> Middleware module Hack.Contrib.Middleware.Head head :: Middleware -- | Paste has a Pony, Rack has a Lobster, Hack has a Lambda >< module Hack.Contrib.Middleware.Lambda lambda :: Middleware -- | Paste has a Pony, Rack has a Lobster, Hack has a Lucky - - module Hack.Contrib.Middleware.Lucky lucky :: Middleware module Hack.Contrib.Middleware.NotFound not_found :: Middleware -- | Stolen from rack: Sets the Content-Length header on responses with -- fixed-length bodies. module Hack.Contrib.Middleware.ContentLength content_length :: Middleware -- | Stolen from rack:serves files below the +root+ given, according to the -- path info of the Rack request. module Hack.Contrib.Middleware.File file :: Maybe String -> Middleware module Hack.Contrib.Middleware.Hub data Severity Debug :: Severity Info :: Severity Warn :: Severity Error :: Severity Fatal :: Severity Unknown :: Severity hint :: Severity -> String type Formatter = Severity -> UTCTime -> Int -> String -> String -> String type Logger = String -> Severity -> IO () hub :: (String -> IO ()) -> Formatter -> String -> Logger simple_logger :: (String -> IO ()) -> String -> Logger simple_formatter :: Formatter colorize :: Severity -> String -> String instance Show Severity instance Eq Severity -- | Stolen from rack: catches all exceptions raised from the app it wraps. module Hack.Contrib.Middleware.ShowExceptions show_exceptions :: Maybe (String -> IO ()) -> Middleware module Hack.Contrib.Middleware.RawRouter route :: [RoutePath] -> Middleware -- | Stolen from rack: catches all empty responses the app it wraps and -- replaces them with a site explaining the error. Additional details can -- be put into hack.showstatus.detail. and will be shown as HTML. If such -- details exist, the error page is always rendered, even if the reply -- was not empty. module Hack.Contrib.Middleware.ShowStatus show_status :: Middleware module Hack.Contrib.Middleware.SimpleAccessLogger simple_access_logger :: Maybe (String -> IO ()) -> Middleware -- | Stolen from rack: Rack::URLMap takes a hash mapping urls or paths to -- apps, and dispatches accordingly. -- -- URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part -- relevant for dispatch is in the SCRIPT_NAME, and the rest in the -- PATH_INFO. This should be taken care of when you need to reconstruct -- the URL in order to create links. -- -- URLMap dispatches in such a way that the longest paths are tried -- first, since they are most specific. module Hack.Contrib.Middleware.SimpleRouter route :: [RoutePath] -> Middleware -- | Stolen from rack: The Rack::Static middleware intercepts requests for -- static files (javascript files, images, stylesheets, etc) based on the -- url prefixes passed in the options, and serves them using a Rack::File -- object. This allows a Rack stack to serve both static and dynamic -- content. module Hack.Contrib.Middleware.Static static :: Maybe String -> [String] -> Middleware -- | Stolen from rack-contrib: Automatically sets the ETag header on all -- String bodies module Hack.Contrib.Middleware.ETag etag :: Middleware -- | Stolen from rack-contrib: Bounce those annoying favicon.ico requests module Hack.Contrib.Middleware.BounceFavicon bounce_favicon :: Middleware