Safe Haskell | None |
---|
Controller routing/handling.
- runHandler :: s -> c -> Pool -> Controller c s () -> Snap ()
- output :: Markup -> Controller c s ()
- outputText :: Text -> Controller c s ()
- goHome :: Controller c s ()
- justOrGoHome :: Maybe a -> (a -> Controller c s ()) -> Controller c s ()
- getInteger :: ByteString -> Integer -> Controller c s Integer
- getString :: ByteString -> String -> Controller c s String
- getStringMaybe :: ByteString -> Controller c s (Maybe String)
- getPagination :: AppConfig c => String -> Controller c s PN
- getMyURI :: AppConfig c => Controller c s URI
Documentation
runHandler :: s -> c -> Pool -> Controller c s () -> Snap ()Source
Run a controller handler.
output :: Markup -> Controller c s ()Source
Strictly renders HTML to Text before outputting it via Snap. This ensures that any lazy exceptions are caught by the Snap handler.
outputText :: Text -> Controller c s ()Source
Strictly renders text before outputting it via Snap. This ensures that any lazy exceptions are caught by the Snap handler.
goHome :: Controller c s ()Source
Generic redirect to home page.
justOrGoHome :: Maybe a -> (a -> Controller c s ()) -> Controller c s ()Source
Extract a Just value or go home.
getInteger :: ByteString -> Integer -> Controller c s IntegerSource
Get integer parmater.
getString :: ByteString -> String -> Controller c s StringSource
Get string.
getStringMaybe :: ByteString -> Controller c s (Maybe String)Source
Get string (maybe).
getPagination :: AppConfig c => String -> Controller c s PNSource
Get pagination data.
getMyURI :: AppConfig c => Controller c s URISource