packages feed

yesod-form 1.7.3 → 1.7.4

raw patch · 3 files changed

+17/−1 lines, 3 files

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for yesod-form +## 1.7.4++* Added a `Monad AForm` instance only when `transformers` >= 0.6 [#1795](https://github.com/yesodweb/yesod/pull/1795)+ ## 1.7.3  * Fixed `radioField` according to Bootstrap 3 docs. [#1783](https://github.com/yesodweb/yesod/pull/1783)
Yesod/Form/Types.hs view
@@ -166,6 +166,18 @@         (a, b, ints', c) <- f mr env ints         (x, y, ints'', z) <- g mr env ints'         return (a <*> x, b . y, ints'', c `mappend` z)++#if MIN_VERSION_transformers(0,6,0)+instance Monad m => Monad (AForm m) where+    (AForm f) >>= k = AForm $ \mr env ints -> do+        (a, b, ints', c) <- f mr env ints+        case a of+          FormSuccess r -> do +            (x, y, ints'', z) <- unAForm (k r) mr env ints'+            return (x, b . y, ints'', c `mappend` z)+          FormFailure err -> pure (FormFailure err, b, ints', c)+          FormMissing -> pure (FormMissing, b, ints', c)+#endif instance (Monad m, Monoid a) => Monoid (AForm m a) where     mempty = pure mempty     mappend a b = mappend <$> a <*> b
yesod-form.cabal view
@@ -1,6 +1,6 @@ cabal-version:   >= 1.10 name:            yesod-form-version:         1.7.3+version:         1.7.4 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>