1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 02:14:20 +03:00

Use a specialized handler for AddressError.

This commit is contained in:
Rob Rix 2018-05-06 15:55:18 -04:00
parent 97159dcfbe
commit 996b5cbd43
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{-# LANGUAGE GADTs, UndecidableInstances #-}
{-# LANGUAGE GADTs, TypeOperators, UndecidableInstances #-}
module Control.Abstract.Addressable where
import Control.Abstract.Evaluator
@ -95,3 +95,6 @@ instance Eq location => Eq1 (AddressError location value) where
throwAddressError :: Member (Resumable (AddressError location value)) effects => AddressError location value resume -> Evaluator location term value effects resume
throwAddressError = raise . Eff.throwError
runAddressError :: Evaluator location term value (Resumable (AddressError location value) ': effects) a -> Evaluator location term value effects (Either (SomeExc (AddressError location value)) a)
runAddressError = raiseHandler runError

View File

@ -39,7 +39,7 @@ justEvaluating
. erroring @(Unspecialized (Value Precise))
. erroring @ResolutionError
. erroring @(EvalError (Value Precise))
. erroring @(AddressError Precise (Value Precise))
. runAddressError
evaluatingWithHoles
= run
@ -60,7 +60,7 @@ checking
. erroring @(Unspecialized (Type Monovariant))
. erroring @ResolutionError
. erroring @(EvalError (Type Monovariant))
. erroring @(AddressError Monovariant (Type Monovariant))
. runAddressError
. typeChecking
. caching @[]