fail package:ghc-lib-parser

The fail operator This is used for `.. <-` "bind statements" in do notation, including non-monadic "binds" in applicative. The fail operator is 'Just expr' if it potentially fail monadically. if the pattern match cannot fail, or shouldn't fail monadically (regular incomplete pattern exception), it is Nothing. See Note [Monad fail : Rebindable syntax, overloaded strings] for the type of expression in the Just case, and why it is so. See Note [Failing pattern matches in Stmts] for which contexts for 'BindStmt's should use the monadic fail and which shouldn't.