diff --git a/src/Analysis/Abstract/BadSyntax.hs b/src/Analysis/Abstract/BadSyntax.hs index 50a5b4c19..a2488a7e5 100644 --- a/src/Analysis/Abstract/BadSyntax.hs +++ b/src/Analysis/Abstract/BadSyntax.hs @@ -13,4 +13,4 @@ import Prologue -- -- > resumingBadSyntax . … resumingBadSyntax :: AbstractHole value => Evaluator location term value (Resumable (Unspecialized value) ': effects) a -> Evaluator location term value effects a -resumingBadSyntax = raiseHandler (relay pure (\ (Resumable err@(Unspecialized _)) yield -> traceM ("Unspecialized:" <> show err) *> yield hole)) +resumingBadSyntax = runUnspecializedWith (\ err@(Unspecialized _) -> traceM ("Unspecialized:" <> show err) *> pure hole) diff --git a/src/Data/Abstract/Evaluatable.hs b/src/Data/Abstract/Evaluatable.hs index 6766337c6..df45dfb09 100644 --- a/src/Data/Abstract/Evaluatable.hs +++ b/src/Data/Abstract/Evaluatable.hs @@ -4,6 +4,7 @@ module Data.Abstract.Evaluatable , Evaluatable(..) , Unspecialized(..) , runUnspecialized +, runUnspecializedWith , EvalError(..) , runEvalError , runEvalErrorWith @@ -203,6 +204,9 @@ instance Show1 (Unspecialized a) where runUnspecialized :: Evaluator location term value (Resumable (Unspecialized value) ': effects) a -> Evaluator location term value effects (Either (SomeExc (Unspecialized value)) a) runUnspecialized = raiseHandler runError +runUnspecializedWith :: (forall resume . Unspecialized value resume -> Evaluator location term value effects resume) -> Evaluator location term value (Resumable (Unspecialized value) ': effects) a -> Evaluator location term value effects a +runUnspecializedWith = runResumableWith + -- Instances