1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 04:11:48 +03:00

Fix up the evaluator spec.

This commit is contained in:
Rob Rix 2018-06-06 09:46:12 -04:00
parent 45db2af4f8
commit b6c8c3f236

View File

@ -30,10 +30,10 @@ spec = parallel $ do
evaluate evaluate
= runM = runM
. fmap (first reassociate)
. evaluating @Precise @(Value Precise (Eff _)) . evaluating @Precise @(Value Precise (Eff _))
. runReader (PackageInfo (name "test") Nothing mempty) . runReader (PackageInfo (name "test") Nothing mempty)
. runReader (ModuleInfo "test/Control/Abstract/Evaluator/Spec.hs") . runReader (ModuleInfo "test/Control/Abstract/Evaluator/Spec.hs")
. fmap reassociate
. runValueError . runValueError
. runEnvironmentError . runEnvironmentError
. runAddressError . runAddressError
@ -42,6 +42,5 @@ evaluate
. runReturn . runReturn
. runLoopControl . 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 :: Either (SomeExc exc1) (Either (SomeExc exc2) (Either (SomeExc exc3) result)) -> Either (SomeExc (Sum '[exc3, exc2, exc1])) result
reassociate (Left s) = Left (SomeExc (inject (Const s))) reassociate = mergeExcs . mergeExcs . mergeExcs . Right
reassociate (Right (Right (Right (Right a)))) = Right a