Text.Digestive.Forms.Happstack
Description
Module providing a happstack backend for the digestive-functors library
- type HappstackForm m e v a = Form (ServerPartT m) Input e v a
- happstackEnvironment :: Monad m => Environment (ServerPartT m) Input
- eitherHappstackForm :: (Monad m, Functor m) => HappstackForm m e v a -> String -> ServerPartT m (Either v a)
Documentation
type HappstackForm m e v a = Form (ServerPartT m) Input e v aSource
Simplification of the Form type, instantiated to Happstack
happstackEnvironment :: Monad m => Environment (ServerPartT m) InputSource
Environment that will fetch input from the parameters parsed by Happstack
Arguments
| :: (Monad m, Functor m) | |
| => HappstackForm m e v a | Form |
| -> String | Form name |
| -> ServerPartT m (Either v a) | Result |
Run a happstack form
- When we are responding to a GET request, you will simply receive the form as a view
- When we are responding to another request method, the form data will be used. When errors occur, you will receive the form as a view, otherwise, you will get the actual result