yesod-form 1.1.0.1 → 1.1.1
raw patch · 2 files changed
+15/−8 lines, 2 files
Files
- Yesod/Form/Functions.hs +14/−7
- yesod-form.cabal +1/−1
Yesod/Form/Functions.hs view
@@ -33,6 +33,7 @@ , check , checkBool , checkM+ , checkMMod , customErrorMessage -- * Utilities , fieldSettingsLabel@@ -355,14 +356,20 @@ => (a -> GHandler sub master (Either msg a)) -> Field sub master a -> Field sub master a-checkM f = checkM' f id+checkM f = checkMMod f id -checkM' :: RenderMessage master msg- => (a -> GHandler sub master (Either msg b))- -> (b -> a)- -> Field sub master a- -> Field sub master b-checkM' f inv field = field+-- | Same as 'checkM', but modifies the datatype.+--+-- In order to make this work, you must provide a function to convert back from+-- the new datatype to the old one (the second argument to this function).+--+-- Since 1.1.1+checkMMod :: RenderMessage master msg+ => (a -> GHandler sub master (Either msg b))+ -> (b -> a)+ -> Field sub master a+ -> Field sub master b+checkMMod f inv field = field { fieldParse = \ts -> do e1 <- fieldParse field ts case e1 of
yesod-form.cabal view
@@ -1,5 +1,5 @@ name: yesod-form-version: 1.1.0.1+version: 1.1.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>