Safe Haskell | None |
---|---|
Language | GHC2021 |
Polysemy.Conc.Effect.Critical
Description
Synopsis
- data Critical (a :: Type -> Type) b where
- catch :: forall (r :: EffectRow) e a. (Member Critical r, Exception e) => Sem r a -> Sem r (Either e a)
- catchAs :: forall e a (r :: EffectRow). (Exception e, Member Critical r) => a -> Sem r a -> Sem r a
- run :: forall (r :: EffectRow) a. Member Critical r => Sem r a -> Sem r (Either SomeException a)
- runAs :: forall (r :: EffectRow) a. Member Critical r => a -> Sem r a -> Sem r a
Documentation
data Critical (a :: Type -> Type) b 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 :: forall (r :: EffectRow) e a. (Member Critical r, Exception e) => Sem r a -> Sem r (Either e a) Source #
Catch all exceptions of type e
in this computation.
catchAs :: forall e a (r :: EffectRow). (Exception e, Member Critical r) => a -> Sem r a -> Sem r a Source #
Catch exceptions of type e
and return a fallback value.