throwError package:extensible-effects

Throw an exception in an effectful computation. The type is inferred.
Throw an exception in an effectful computation. The type is unit, which suppresses the ghc-mod warning "A do-notation statement discarded a result of type"
Run a computation until it produces an exception, and convert and throw that exception in a new context.