Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
data Critical :: Effect where Source #
An effect that catches exceptions.
Provides the exact functionality of fromExceptionSem
, but pushes the dependency on Final IO
to the
interpreter, and makes it optional.
Catch :: Exception e => m a -> Critical m (Either e a) | Catch all exceptions of type |
Instances
type DefiningModule Critical Source # | |
Defined in Polysemy.Conc.Effect.Critical |
catchAs :: forall e a r. Exception e => Member Critical r => a -> Sem r a -> Sem r a Source #
Catch exceptions of type e
and return a fallback value.
run :: Member Critical r => Sem r a -> Sem r (Either SomeException a) Source #
Convenience overload for SomeException
.