fail package:valor

Constructs a validator that always fails with provided error e.

Example

>>> validateP ( fail "YOU SHALL NOT PASS!!!" ) 1
Right "YOU SHALL NOT PASS!!!"
A validator that fails with e if the predicate returns True.

Example

>>> validateP ( failIf "must be less than or equal to 0" (>0) ) 1
Right "must be less than or equal to 0"
>>> validateP ( failIf "must be less than or equal to 0" (>0) ) (-20)
Left (Valid (-20))
A monadic version of failIf.