catch package:capability

Provide a handler for exceptions thrown in the given action in the given exception capability.
Like catch, but only handle the exception if the provided function returns Just.
For technical reasons, this method needs an extra proxy argument. You only need it if you are defining new instances of HasReader. Otherwise, you will want to use catchJust. See catchJust for more documentation.
For technical reasons, this method needs an extra proxy argument. You only need it if you are defining new instances of HasReader. Otherwise, you will want to use catch. See catch for more documentation.
Capability to catch exceptions of type e under tag. HasThrow/HasCatch capabilities at different tags should be independent. In particular, the following program should throw SomeError and not return (). > example :: > (HasThrow Left SomeError m, HasCatch Right SomeError m) > => m () > example = > catch Left > (throw Right SomeError) > _ -> pure () See wrapError for a way to combine multiple exception types into one.
Type synonym using the TypeOf type family to specify HasCatch constraints without having to specify the type associated to a tag.
Derive 'HasCatch from m's 'Control.Monad.Catch.MonadCatch instance.