fail is:exact

Important note

This ignores whatever String you give it. It is a bad idea to use fail as a form of labelled error; instead, it should only be defaulted to when a pattern match fails.
Forward-compatible MonadFail class This package contains the Control.Monad.Fail module providing the MonadFail class that became available in base-4.9.0.0 for older base package versions. This package turns into an empty package when used with GHC versions which already provide the Control.Monad.Fail module to make way for GHC's own Control.Monad.Fail module.
Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a do expression. As part of the MonadFail proposal (MFP), this function is moved to its own class MonadFail (see Control.Monad.Fail for more details). The definition here will be removed in a future release.
Fail with the provided error message.
Lift an IOError to the answer type, similar to fail. This fail function aims to be used as the last statement of a do block.
Constructs a validator that always fails with provided error e.

Example

>>> validateP ( fail "YOU SHALL NOT PASS!!!" ) 1
Right "YOU SHALL NOT PASS!!!"