1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Run unspecialized errors with a specialized handler.

This commit is contained in:
Rob Rix 2018-05-06 16:00:55 -04:00
parent 05baa63939
commit 1f0bc214e6
2 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@ module Data.Abstract.Evaluatable
( module X
, Evaluatable(..)
, Unspecialized(..)
, runUnspecialized
, EvalError(..)
, LoadError(..)
, runLoadError
@ -183,6 +184,9 @@ deriving instance Show (Unspecialized a b)
instance Show1 (Unspecialized a) where
liftShowsPrec _ _ = showsPrec
runUnspecialized :: Evaluator location term value (Resumable (Unspecialized value) ': effects) a -> Evaluator location term value effects (Either (SomeExc (Unspecialized value)) a)
runUnspecialized = raiseHandler runError
-- Instances

View File

@ -36,7 +36,7 @@ justEvaluating
. evaluating
. runLoadError
. erroring @(ValueError Precise (Value Precise))
. erroring @(Unspecialized (Value Precise))
. runUnspecialized
. erroring @ResolutionError
. erroring @(EvalError (Value Precise))
. runAddressError
@ -57,7 +57,7 @@ checking
. evaluating
. providingLiveSet
. runLoadError
. erroring @(Unspecialized (Type Monovariant))
. runUnspecialized
. erroring @ResolutionError
. erroring @(EvalError (Type Monovariant))
. runAddressError