test package:valor

Apply one or the other validator depending on the result of a test.

Example

>>> let exV = test pass (fail "I'm a failure") (pure . (>3))
>>> validateP exV 3
Left (Valid 3)
>>> validateP exV 4
Right "I'm a failure"