mirror of
https://github.com/github/semantic.git
synced 2024-12-20 05:11:44 +03:00
Define a parameterized handler for Unspecialized errors.
This commit is contained in:
parent
3a79bc0dc3
commit
55997e5c60
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user