mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Split the evaluation of a package body out into a new function.
This commit is contained in:
parent
9266439e7f
commit
5d6c57312e
@ -186,8 +186,13 @@ evaluatePackage :: ( Effectful m
|
||||
)
|
||||
=> Package term
|
||||
-> m effects [value]
|
||||
evaluatePackage p = pushOrigin (packageOrigin p) (localModuleTable (<> packageModules (packageBody p))
|
||||
(traverse evaluateEntryPoint (ModuleTable.toPairs (packageEntryPoints (packageBody p)))))
|
||||
evaluatePackage p = pushOrigin (packageOrigin p) (evaluatePackageBody (packageBody p))
|
||||
|
||||
evaluatePackageBody :: MonadEvaluatable location term value m
|
||||
=> PackageBody term
|
||||
-> m [value]
|
||||
evaluatePackageBody body = localModuleTable (<> packageModules body)
|
||||
(traverse evaluateEntryPoint (ModuleTable.toPairs (packageEntryPoints body)))
|
||||
where evaluateEntryPoint (m, sym) = do
|
||||
(_, v) <- require m
|
||||
maybe (pure v) ((`call` []) <=< variable) sym
|
||||
|
Loading…
Reference in New Issue
Block a user