on master help sign in
src/Control/Monad/Validation.hs+3−13
since splitsnapshots
unifiedsplit
@@ -16,7 +16,6 @@ module Control.Monad.Validation
16 , vWarningL
16 , vWarningL
17 , vZoom
17 , vZoom
18 , vZoomL
18 , vZoomL
19− , vPromote
20 , mmSingleton
19 , mmSingleton
21 , setMempty
20 , setMempty
22 , neConcat
21 , neConcat
@@ -144,12 +143,12 @@ neConcat f a
144textErrors :: [Text] -> Maybe Text
143textErrors :: [Text] -> Maybe Text
145textErrors = neConcat (\a b -> a <> ", " <> b)
144textErrors = neConcat (\a b -> a <> ", " <> b)
146
145
147−-- | Returns 'mempty' instead of error if no warnings have occurred.
146+-- | Returns 'mempty' instead of error if no warnings have occured.
148-- Returns 'Nothing' as the second element of tuple if computation was
147-- Returns 'Nothing' as the second element of tuple if computation was
149-- interrupted by 'vError'.
148-- interrupted by 'vError'.
150--
149--
151-- Returns all concatenated errors and warnings and the result if no
150-- Returns all concatenated errors and warnings and the result if no
152−-- errors have occurred (warnings could have occurred).
151+-- errors have occured (warnings could have occured).
153--
152--
154-- >>> :{
153-- >>> :{
155-- runValidationT $ do
154-- runValidationT $ do
@@ -175,7 +174,7 @@ runValidationT (ValidationT m) = do
175 Right a -> (warnings, Just a)
174 Right a -> (warnings, Just a)
176
175
177-- | Like 'runValidationT' but doesn't return the result
176-- | Like 'runValidationT' but doesn't return the result
178−-- if any warning has occurred.
177+-- if any warning has occured.
179--
178--
180-- >>> :{
179-- >>> :{
181-- runValidationTEither $ do
180-- runValidationTEither $ do
@@ -286,12 +285,3 @@ vZoomL
286 -> ValidationT a m x
285 -> ValidationT a m x
287 -> ValidationT b m x
286 -> ValidationT b m x
288vZoomL l = vZoom (setMempty l)
287vZoomL l = vZoom (setMempty l)
289−
290−-- | Turn any warnings the have occurred into errors.
291−vPromote
292− :: (Monad m, Monoid a, Eq a)
293− => ValidationT a m x
294− -> ValidationT a m x
295−vPromote m = do
296− err <- lift $ runValidationTEither m
297− either vError return err
validationt.cabal+1−1
@@ -2,7 +2,7 @@
2-- documentation, see http://haskell.org/cabal/users-guide/
2-- documentation, see http://haskell.org/cabal/users-guide/
3
3
4name: validationt
4name: validationt
5−version: 0.3.1
5+version: 0.3.0
6synopsis: Straightforward validation monad.
6synopsis: Straightforward validation monad.
7description: Convenient solution for validating web forms and APIs.
7description: Convenient solution for validating web forms and APIs.
8homepage: https://github.com/typeable/validationt
8homepage: https://github.com/typeable/validationt