packages feed

ditto-lucid 0.3.1 → 0.3.2

raw patch · 2 files changed

+4/−11 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Ditto.Lucid: withErrors :: (Monad m, ToHtml error, Monad f) => [Attribute] -> ([error] -> HtmlT f ()) -> Form m input error (HtmlT f ()) a -> Form m input error (HtmlT f ()) a
+ Ditto.Lucid: withErrors :: (Monad m, ToHtml error, Monad f) => (HtmlT f () -> [error] -> HtmlT f ()) -> Form m input error (HtmlT f ()) a -> Form m input error (HtmlT f ()) a

Files

ditto-lucid.cabal view
@@ -1,5 +1,5 @@ Name:                ditto-lucid-Version:             0.3.1+Version:             0.3.2 Synopsis:            Add support for using lucid with Ditto Description:         Ditto is a library for building and validating forms using applicative functors. This package add support for using ditto with lucid. License:             BSD3
src/Ditto/Lucid.hs view
@@ -83,22 +83,15 @@   mkError :: Monad f => ToHtml a => a -> HtmlT f ()   mkError e = li_ [] $ toHtml e --- | create a @\<ul\>@ which contains all the errors related to the 'Form'.------ Includes errors from child forms.+-- | create a sibling element to the formlet which includes its error message -- -- The @<\ul\>@ will have the attribute @class=\"ditto-error-list\"@. withErrors   :: (Monad m, ToHtml error, Monad f)-  => [Attribute]-  -> ([error] -> HtmlT f ())+  => (HtmlT f () -> [error] -> HtmlT f ())   -> Form m input error (HtmlT f ()) a   -> Form m input error (HtmlT f ()) a-withErrors attrs renderError form = G.withErrors mkErrors form-  where-  mkErrors formlet errs = -    formlet `with` attrs-    <* renderError errs+withErrors renderError form = G.withErrors renderError form  -- | create a @\<br\>@ tag. br :: (Monad m, Applicative f) => Form m input error (HtmlT f ()) ()