1
1
mirror of https://github.com/github/semantic.git synced 2024-12-11 08:45:48 +03:00

Rename fromList to fromModules.

This commit is contained in:
Rob Rix 2018-03-30 18:55:15 -04:00
parent fec4e09c25
commit be84d9ff78
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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)]