digestive-functors-happstack-0.0.2.0: Happstack backend for the digestive-functors library

Text.Digestive.Forms.Happstack

Description

Module providing a happstack backend for the digestive-functors library

Synopsis

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

eitherHappstackFormSource

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