1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 12:21:57 +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
= 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