1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 12:21:57 +03:00

Move the Reader effects to the head of UtilEff.

This commit is contained in:
Rob Rix 2018-08-15 11:49:21 -04:00
parent bb021d404a
commit 4d08e47cf0
2 changed files with 7 additions and 7 deletions

View File

@ -100,10 +100,10 @@ repl proxy parser paths = defaultConfig debugOptions >>= \ config -> runM . runD
. runResolutionError
. runAddressError
. runValueError
. runReader (packageInfo package)
. runReader (lowerBound @Span)
. runReader (lowerBound @(ModuleTable (NonEmpty (Module (ModuleResult Precise)))))
. raiseHandler (runModules (ModuleTable.modulePaths (packageModules (snd <$> package))))
. runReader (packageInfo package)
. runReader (lowerBound @Span)
$ evaluate proxy id (withTermSpans . step (fmap (\ (x:|_) -> moduleBody x) <$> ModuleTable.toPairs (packageModules (fst <$> package)))) (Precise.runAllocator . Precise.runDeref) (Concrete.runFunction coerce coerce) modules
-- TODO: REPL for typechecking/abstract semantics

View File

@ -56,10 +56,10 @@ justEvaluating
newtype UtilEff address rest a = UtilEff
{ runUtilEff :: Eff ( ValueEffects address (Value address (UtilEff address rest))
( ModuleEffects address (Value address (UtilEff address rest))
( Modules address
': Reader (ModuleTable (NonEmpty (Module (ModuleResult address))))
': Reader Span
( Reader Span
': Reader PackageInfo
': Modules address
': Reader (ModuleTable (NonEmpty (Module (ModuleResult address))))
': Resumable (BaseError (ValueError address (UtilEff address rest)))
': Resumable (BaseError (AddressError address (Value address (UtilEff address rest))))
': Resumable (BaseError ResolutionError)
@ -121,10 +121,10 @@ evaluateProject' (TaskConfig config logger statter) proxy parser paths = either
modules <- topologicalSort <$> runImportGraphToModules proxy package
trace $ "evaluating with load order: " <> show (map (modulePath . moduleInfo) modules)
pure (runTermEvaluator @_ @_ @(Value Precise (UtilEff Precise _))
(runReader (packageInfo package)
(runReader (lowerBound @Span)
(runReader (lowerBound @(ModuleTable (NonEmpty (Module (ModuleResult Precise)))))
(raiseHandler (runModules (ModuleTable.modulePaths (packageModules package)))
(runReader (packageInfo package)
(runReader (lowerBound @Span)
(evaluate proxy id withTermSpans (Precise.runAllocator . Precise.runDeref) (Concrete.runFunction coerce coerce) modules))))))