Constructor for computations in the ExceptT monad. (The inverse of runExceptT).
Moduletransformers-except-0.1.4Haskell98
Control.Monad.Trans.Except.Extra
This monad transformer extends Control.Monad.Trans.Except with a few more conveniences.
- 25 values
- Packagetransformers-except-0.1.4
- Exports25
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceExtra.hs
Control.Monad.Trans.Except.Extra
8 declarationsThe inverse of ExceptT.
Map over both arguments at the same time.
Specialised version of bimap for ExceptT.
Constructor for left computations.
Constructor for right computations.
Map the unwrapped computation using the given function.
runExceptT (mapExceptT f m) = f (runExceptT m)
Map the unwrapped computation using the given function.
Extensions
17 declarationsMap the Left unwrapped computation using the given function.
Map the Right unwrapped computation using the given function.
Try an IO action inside an ExceptT. If the IO action throws an IOException, catch it and wrap it with the provided handler to convert it to the error type of the ExceptT transformer. Exceptions other than IOException will escape the ExceptT transformer.
Note: IOError is a type synonym for IOException.
Try any monad action and catch the specified exception, wrapping it to convert it to the error type of the ExceptT transformer. Exceptions other that the specified exception type will escape the ExceptT transformer.
Warning*: This function should be used with caution! In particular, it is bad practice to catch SomeException because that includes asynchronous exceptions like stack/heap overflow, thread killed and user interrupt. Trying to handle
StackOverflow,HeapOverflowandThreadKilledexceptions could cause your program to crash or behave in unexpected ways.
Handle an error. Equivalent to handleError in mtl package.
Flipped handleIOExceptT.
Flipped handleExceptT.
Flipped handlesExceptT.
Flipped handleLeftT.
Acquire a resource in ExceptT and then perform an action with it, cleaning up afterwards regardless of left.
This function does not clean up in the event of an exception. Prefer bracketExceptionT in any impure setting.
Acquire a resource in ExceptT and then perform an action with it, cleaning up afterwards regardless of left or exception.
Like bracketExceptT, but the cleanup is called even when the bracketed function throws an exception. Exceptions in the bracketed function are caught to allow the cleanup to run and then rethrown.
Convert an Either to a Maybe and execute the supplied handler in the Left case.
Handle the Left constructor in returned Either.
Handle the Nothing constructor in returned Maybe.