1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 21:47:07 +03:00

Preserve the Modules during evaluation.

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
This commit is contained in:
Rob Rix 2018-06-15 15:08:36 -04:00
parent 3d45ab4623
commit 05933691d4

View File

@ -87,14 +87,14 @@ evaluate :: forall address term value effects
, Reducer value (Cell address value)
, ValueRoots address value
)
=> LoadOrder (NonEmpty (Module term)) (NonEmpty (address, Environment address))
-> Evaluator address value effects (NonEmpty (address, Environment address))
=> LoadOrder (NonEmpty (Module term)) (NonEmpty (Module (address, Environment address)))
-> Evaluator address value effects (NonEmpty (Module (address, Environment address)))
evaluate (Done results) = pure results
evaluate (Load modules continue)
= (>>= evaluate . continue)
. runReader lowerBound
. runModules evalModule
$ traverse evalModule modules
$ traverse evalModuleAndRetain modules
where evalModule :: Module term -> Evaluator address value (Modules address value ': effects) (address, Environment address)
evalModule m
= runReader (moduleInfo m)
@ -104,6 +104,8 @@ evaluate (Load modules continue)
. runLoopControl
$ foldSubterms eval (moduleBody m) >>= address
evalModuleAndRetain m = (<$ m) <$> evalModule m
-- | Evaluate a given package.
evaluatePackageWith :: forall address term value inner inner' inner'' outer
. ( AbstractValue address value inner