From b6c8c3f2364d6e8c7b84ed6b184b24c441853608 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 6 Jun 2018 09:46:12 -0400 Subject: [PATCH] Fix up the evaluator spec. --- test/Control/Abstract/Evaluator/Spec.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/Control/Abstract/Evaluator/Spec.hs b/test/Control/Abstract/Evaluator/Spec.hs index 28100f6b1..324af9d71 100644 --- a/test/Control/Abstract/Evaluator/Spec.hs +++ b/test/Control/Abstract/Evaluator/Spec.hs @@ -30,10 +30,10 @@ spec = parallel $ do evaluate = runM - . fmap (first reassociate) . evaluating @Precise @(Value Precise (Eff _)) . runReader (PackageInfo (name "test") Nothing mempty) . runReader (ModuleInfo "test/Control/Abstract/Evaluator/Spec.hs") + . fmap reassociate . runValueError . runEnvironmentError . runAddressError @@ -42,6 +42,5 @@ evaluate . runReturn . runLoopControl -reassociate :: Either Prelude.String (Either (SomeExc exc1) (Either (SomeExc exc2) (Either (SomeExc exc3) result))) -> Either (SomeExc (Sum '[Const Prelude.String, exc1, exc2, exc3])) result -reassociate (Left s) = Left (SomeExc (inject (Const s))) -reassociate (Right (Right (Right (Right a)))) = Right a +reassociate :: Either (SomeExc exc1) (Either (SomeExc exc2) (Either (SomeExc exc3) result)) -> Either (SomeExc (Sum '[exc3, exc2, exc1])) result +reassociate = mergeExcs . mergeExcs . mergeExcs . Right