monad-validate
monad-validate copied to clipboard
Get access to errors AND result value
It would be great to have access to 'tolerated' errors AND the result value in cases where there is no catastrophic failure:
runValidateTtolerate :: Functor f => ValidateT a f b -> f (Maybe a, Maybe b)
runValidateTtolerate m = unValidateT MNothing m <&> \case
Left e -> (Just e, Nothing)
Right (MJust e, v) -> (Just e, Just v)
Right (MNothing, v) -> (Nothing, Just v)
Does it makes sense to add a function like this?