@@ -16,7 +16,6 @@ module Control.Monad.Validation
16 , vWarningL
16 , vWarningL
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)
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'.
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).
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)
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.
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)
290−-- | Turn any warnings the have occurred into errors.
292− :: (Monad m, Monoid a, Eq a)
293− => ValidationT a m x
294− -> ValidationT a m x
296− err <- lift $ runValidationTEither m
297− either vError return err