A convenience function for throwing a user error. This is useful for
cases where it would be too high a burden to define your own exception
type.
This throws an exception of type StringException. When GHC
supports it (base 4.9 and GHC 8.0 and onward), it includes a call
stack.
When you encounter an error where the only sane way to handle it is to
write an error to the log and die messily, use fatalError. This is a
good candidate for things like not being able to find configuration
files on startup.
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.