-- | Description: Polysemy effects for cross-interpreter error tracking. module Polysemy.Resume ( -- * Introduction -- $intro module Polysemy.Resume.Effect.Stop, module Polysemy.Resume.Effect.Resumable, -- * Resuming a Stopped Computation resume, (!!), interpretResumable, interpretResumableH, interceptResumable, interceptResumableH, interceptResumableUsing, interceptResumableUsingH, resumable, raiseResumable, resumableIO, interpretScopedResumable, interpretScopedResumableH, interpretScopedResumable_, interpretScopedResumableWith, interpretScopedResumableWithH, interpretScopedResumableWith_, interpretResumableScoped, interpretResumableScopedH, interpretResumableScoped_, interpretResumableScopedWith, interpretResumableScopedWithH, interpretResumableScopedWith_, interpretScopedR, interpretScopedRH, interpretScopedR_, interpretScopedRWith, interpretScopedRWithH, interpretScopedRWith_, -- * Partial Handlers -- $partial resumableOr, -- * Various Combinators resumeAs, (), resumeWith, (!>>), resumingWith, (<), (!>>), ( -- InterpreterFor Stopper r -- interpretStopper = -- interpret \\case -- StopBang -> throw (Bang 13) -- StopBoom -> throw (Boom "ouch") -- @ -- -- If we want to use @Stopper@ in the interpreter of another effect, we have no way of knowing about the errors thrown -- by its interpreter, even though we can catch @Boom@! -- This library makes the connection explicit by changing 'Polysemy.Error.Error' to 'Stop' and wrapping @Stopper@ in -- 'Resumable' when using it in an effect stack: -- $partial -- In some cases, the errors thrown by an interpreter contain details about the implementation, which we might want to -- hide from dependents; or it may throw fatal errors we don't want to handle at all. -- For this purpose, we can create partial 'Resumable's by transforming errors before handling them: