1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Run resolution errors with a specialized handler.

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

View File

@ -8,6 +8,7 @@ module Data.Abstract.Evaluatable
, LoadError(..) , LoadError(..)
, runLoadError , runLoadError
, ResolutionError(..) , ResolutionError(..)
, runResolutionError
, variable , variable
, evaluateInScopedEnv , evaluateInScopedEnv
, evaluatePackageWith , evaluatePackageWith
@ -97,6 +98,9 @@ instance Eq1 ResolutionError where
liftEq _ (GoImportError a) (GoImportError b) = a == b liftEq _ (GoImportError a) (GoImportError b) = a == b
liftEq _ _ _ = False liftEq _ _ _ = False
runResolutionError :: Evaluator location term value (Resumable ResolutionError ': effects) a -> Evaluator location term value effects (Either (SomeExc ResolutionError) a)
runResolutionError = raiseHandler runError
-- | An error thrown when loading a module from the list of provided modules. Indicates we weren't able to find a module with the given name. -- | An error thrown when loading a module from the list of provided modules. Indicates we weren't able to find a module with the given name.
data LoadError term resume where data LoadError term resume where
LoadError :: ModulePath -> LoadError term [Module term] LoadError :: ModulePath -> LoadError term [Module term]

View File

@ -37,7 +37,7 @@ justEvaluating
. runLoadError . runLoadError
. erroring @(ValueError Precise (Value Precise)) . erroring @(ValueError Precise (Value Precise))
. runUnspecialized . runUnspecialized
. erroring @ResolutionError . runResolutionError
. erroring @(EvalError (Value Precise)) . erroring @(EvalError (Value Precise))
. runAddressError . runAddressError
@ -58,7 +58,7 @@ checking
. providingLiveSet . providingLiveSet
. runLoadError . runLoadError
. runUnspecialized . runUnspecialized
. erroring @ResolutionError . runResolutionError
. erroring @(EvalError (Type Monovariant)) . erroring @(EvalError (Type Monovariant))
. runAddressError . runAddressError
. typeChecking . typeChecking