ExceptT package:dunai

A monad transformer that adds exceptions to other monads. ExceptT constructs a monad parameterized over two things:
  • e - The exception type.
  • m - The inner monad.
The return function yields a computation that produces the given value, while >>= sequences two subcomputations, exiting on the first exception.
Convert exceptions into Nothing, discarding the exception value.
Convert a ExceptT computation to MaybeT, discarding the value of any exception.
Execute an MSF and, if it throws an exception, recover by switching to a second MSF.
Embed an ExceptT value inside the MSF. Whenever the input value is an ordinary value, it is passed on. If it is an exception, it is raised.
Map the unwrapped computation using the given function.
The inverse of ExceptT.
Transform any exceptions thrown by the computation using the given function.
Convert a MaybeT computation to ExceptT, with a default exception value.