diff --git a/src/Data/Abstract/Evaluatable.hs b/src/Data/Abstract/Evaluatable.hs index dc6850090..1fa94330a 100644 --- a/src/Data/Abstract/Evaluatable.hs +++ b/src/Data/Abstract/Evaluatable.hs @@ -178,7 +178,7 @@ withModules :: MonadEvaluatable location term value m => [Module term] -> m a -> m a -withModules = localModuleTable . const . ModuleTable.fromList +withModules = localModuleTable . const . ModuleTable.fromModules -- | Evaluate with a list of modules in scope, taking the head module as the entry point. evaluateModules :: MonadEvaluatable location term value m diff --git a/src/Data/Abstract/ModuleTable.hs b/src/Data/Abstract/ModuleTable.hs index c3b606254..37d378094 100644 --- a/src/Data/Abstract/ModuleTable.hs +++ b/src/Data/Abstract/ModuleTable.hs @@ -4,7 +4,7 @@ module Data.Abstract.ModuleTable , ModuleTable (..) , lookup , insert -, fromList +, fromModules , toPairs ) where @@ -25,8 +25,8 @@ insert k v ModuleTable{..} = ModuleTable (Map.insert k v unModuleTable) -- | Construct a 'ModuleTable' from a list of 'Module's. -fromList :: [Module term] -> ModuleTable [Module term] -fromList = ModuleTable . Map.fromListWith (<>) . map toEntry +fromModules :: [Module term] -> ModuleTable [Module term] +fromModules = ModuleTable . Map.fromListWith (<>) . map toEntry where toEntry m = (moduleName m, [m]) toPairs :: ModuleTable a -> [(ModuleName, a)]