From e3dd3b51a3a9c8e118cc2d4ba9fdaf025975b3b5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 22 Oct 2018 12:06:45 -0400 Subject: [PATCH] Simplify the EvalError carriers. --- src/Data/Abstract/Evaluatable.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Data/Abstract/Evaluatable.hs b/src/Data/Abstract/Evaluatable.hs index 0648a38ec..1d56a97a9 100644 --- a/src/Data/Abstract/Evaluatable.hs +++ b/src/Data/Abstract/Evaluatable.hs @@ -296,11 +296,11 @@ instance Eq1 EvalError where instance Show1 EvalError where liftShowsPrec _ _ = showsPrec -runEvalError :: (Carrier sig m, Effect sig) => Evaluator term address value (ResumableC (BaseError EvalError) (Evaluator term address value m)) a -> Evaluator term address value m (Either (SomeError (BaseError EvalError)) a) -runEvalError = runResumable . runEvaluator +runEvalError :: (Carrier sig m, Effect sig) => Evaluator term address value (ResumableC (BaseError EvalError) (Eff m)) a -> Evaluator term address value m (Either (SomeError (BaseError EvalError)) a) +runEvalError = Evaluator . runResumable . runEvaluator -runEvalErrorWith :: Carrier sig m => (forall resume . (BaseError EvalError) resume -> Evaluator term address value m resume) -> Evaluator term address value (ResumableWithC (BaseError EvalError) (Evaluator term address value m)) a -> Evaluator term address value m a -runEvalErrorWith f = runResumableWith f . runEvaluator +runEvalErrorWith :: Carrier sig m => (forall resume . (BaseError EvalError) resume -> Evaluator term address value m resume) -> Evaluator term address value (ResumableWithC (BaseError EvalError) (Eff m)) a -> Evaluator term address value m a +runEvalErrorWith f = Evaluator . runResumableWith (runEvaluator . f) . runEvaluator throwEvalError :: ( Member (Reader ModuleInfo) sig , Member (Reader Span) sig