Module providing a happstack backend for the digestive-functors library
- type HappstackForm m e v a = Form m [Input] e v a
- happstackEnvironment :: (HasRqData m, MonadPlus m, Alternative m) => Environment m [Input]
- eitherHappstackForm :: (HasRqData m, MonadPlus m, Alternative m, ServerMonad m) => HappstackForm m e v a -> String -> m (Either v a)
Documentation
type HappstackForm m e v a = Form m [Input] e v aSource
Simplification of the Form
type, instantiated to Happstack
happstackEnvironment :: (HasRqData m, MonadPlus m, Alternative m) => Environment m [Input]Source
Environment that will fetch input from the parameters parsed by Happstack
:: (HasRqData m, MonadPlus m, Alternative m, ServerMonad m) | |
=> HappstackForm m e v a | Form |
-> String | Form name |
-> 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