polysemy-resume-0.9.0.1: Polysemy error tracking
Safe HaskellNone
LanguageGHC2021

Polysemy.Resume.Effect.Stop

Description

 
Synopsis

Documentation

data Stop e (a :: Type -> Type) b where Source #

An effect similar to Error without the ability to be caught. Used to signal that an error is supposed to be expected by dependent programs.

interpretStopper ::
  Member (Stop Boom) r =>
  InterpreterFor Stopper r
interpretStopper =
  interpret \case
    StopBang -> stop (Bang 13)
    StopBoom -> stop (Boom "ouch")

Constructors

Stop :: forall e (a :: Type -> Type) b. e -> Stop e a b

Abort a computation with an error value.

stop :: forall e (r :: EffectRow) a. Member (Stop e) r => e -> Sem r a Source #

Abort a computation with an error value.