yesodweb/yesod — pull request #888 by kccqzy (2014-12-12 15:07:21+00:00)
Title: Add MFormInput for monadic processing of FormInput

I think `FormInput` should have a `Monad` instance because there are situations when you want the validation of a field to depend on the value of another one. This is not possible with `Applicative`.

I chose to create a `newtype` instead of just adding a `Monad` instance because, necessarily, they have different behaviours in terms of error messages. In `MFormInput` if a validation of a field fails, there is no way to continue to validate the remaining fields because they may depend on the value of the current one. So there may be at most one error message. This difference in behaviour makes me think it is needed to distinguish between the regular `Applicative`-style `FormInput` and `MFormInput`.

`MFormInput` might be a confusing name though, since we already have `MForm`s. Can't think of a better name there…