hw-polysemy-0.2.5.0: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageGHC2021

HaskellWorks.Polysemy.Error

Synopsis

Documentation

trap :: forall e r a. (e -> Sem r a) -> Sem (Error e ': r) a -> Sem r a Source #

Run a computation that may fail, and handle the error case. Unlike catch from Error this function removes the Error effect from the stack.

trap_ :: forall e r a. Sem r a -> Sem (Error e ': r) a -> Sem r a Source #

Like trap, but the error is not passed to the handler.