00511474f4e8eef01b26857907b65de4a74862d3
[ghc.git] / compiler / basicTypes / Module.hs
1 {-
2 (c) The University of Glasgow, 2004-2006
3
4
5 Module
6 ~~~~~~~~~~
7 Simply the name of a module, represented as a FastString.
8 These are Uniquable, hence we can build Maps with Modules as
9 the keys.
10 -}
11
12 {-# LANGUAGE DeriveDataTypeable #-}
13 {-# LANGUAGE RecordWildCards #-}
14
15 module Module
16 (
17 -- * The ModuleName type
18 ModuleName,
19 pprModuleName,
20 moduleNameFS,
21 moduleNameString,
22 moduleNameSlashes, moduleNameColons,
23 moduleStableString,
24 mkModuleName,
25 mkModuleNameFS,
26 stableModuleNameCmp,
27
28 -- * The UnitId type
29 UnitId,
30 fsToUnitId,
31 unitIdFS,
32 stringToUnitId,
33 unitIdString,
34 stableUnitIdCmp,
35
36 -- * Wired-in UnitIds
37 -- $wired_in_packages
38 primUnitId,
39 integerUnitId,
40 baseUnitId,
41 rtsUnitId,
42 thUnitId,
43 dphSeqUnitId,
44 dphParUnitId,
45 mainUnitId,
46 thisGhcUnitId,
47 holeUnitId, isHoleModule,
48 interactiveUnitId, isInteractiveModule,
49 wiredInUnitIds,
50
51 -- * The Module type
52 Module(Module),
53 moduleUnitId, moduleName,
54 pprModule,
55 mkModule,
56 stableModuleCmp,
57 HasModule(..),
58 ContainsModule(..),
59
60 -- * The ModuleLocation type
61 ModLocation(..),
62 addBootSuffix, addBootSuffix_maybe, addBootSuffixLocn,
63
64 -- * Module mappings
65 ModuleEnv,
66 elemModuleEnv, extendModuleEnv, extendModuleEnvList,
67 extendModuleEnvList_C, plusModuleEnv_C,
68 delModuleEnvList, delModuleEnv, plusModuleEnv, lookupModuleEnv,
69 lookupWithDefaultModuleEnv, mapModuleEnv, mkModuleEnv, emptyModuleEnv,
70 moduleEnvKeys, moduleEnvElts, moduleEnvToList,
71 unitModuleEnv, isEmptyModuleEnv,
72 foldModuleEnv, extendModuleEnvWith, filterModuleEnv,
73
74 -- * ModuleName mappings
75 ModuleNameEnv,
76
77 -- * Sets of Modules
78 ModuleSet,
79 emptyModuleSet, mkModuleSet, moduleSetElts, extendModuleSet, elemModuleSet
80 ) where
81
82 import Config
83 import Outputable
84 import Unique
85 import UniqFM
86 import FastString
87 import Binary
88 import Util
89 import {-# SOURCE #-} Packages
90 import GHC.PackageDb (BinaryStringRep(..))
91
92 import Data.Data
93 import Data.Map (Map)
94 import qualified Data.Map as Map
95 import qualified FiniteMap as Map
96 import System.FilePath
97
98 -- Note [The identifier lexicon]
99 -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100 -- Package keys, installed package IDs, ABI hashes, package names,
101 -- versions, there are a *lot* of different identifiers for closely
102 -- related things. What do they all mean? Here's what. (See also
103 -- https://ghc.haskell.org/trac/ghc/wiki/Commentary/Packages/Concepts )
104 --
105 -- THE IMPORTANT ONES
106 --
107 -- ComponentId: An opaque identifier provided by Cabal, which should
108 -- uniquely identify such things as the package name, the package
109 -- version, the name of the component, the hash of the source code
110 -- tarball, the selected Cabal flags, GHC flags, direct dependencies of
111 -- the component. These are very similar to InstalledPackageId, but
112 -- an 'InstalledPackageId' implies that it identifies a package, while
113 -- a package may install multiple components with different
114 -- 'ComponentId's.
115 -- - Same as Distribution.Package.ComponentId
116 --
117 -- UnitId: A ComponentId + a mapping from hole names (ModuleName) to
118 -- Modules. This is how the compiler identifies instantatiated
119 -- components, and also is the main identifier by which GHC identifies
120 -- things.
121 -- - When Backpack is not being used, UnitId = ComponentId.
122 -- this means a useful fiction for end-users is that there are
123 -- only ever ComponentIds, and some ComponentIds happen to have
124 -- more information (UnitIds).
125 -- - Same as Language.Haskell.TH.Syntax:PkgName, see
126 -- https://ghc.haskell.org/trac/ghc/ticket/10279
127 -- - The same as PackageKey in GHC 7.10 (we renamed it because
128 -- they don't necessarily identify packages anymore.)
129 -- - Same as -this-package-key/-package-name flags
130 --
131 -- Module: A UnitId + ModuleName. This is how the compiler identifies
132 -- modules (e.g. a Name is a Module + OccName)
133 -- - Same as Language.Haskell.TH.Syntax:Module
134 --
135 -- THE LESS IMPORTANT ONES
136 --
137 -- PackageName: The "name" field in a Cabal file, something like "lens".
138 -- - Same as Distribution.Package.PackageName
139 -- - DIFFERENT FROM Language.Haskell.TH.Syntax:PkgName, see
140 -- https://ghc.haskell.org/trac/ghc/ticket/10279
141 -- - DIFFERENT FROM -package-name flag
142 -- - DIFFERENT FROM the 'name' field in an installed package
143 -- information. This field could more accurately be described
144 -- as a munged package name: when it's for the main library
145 -- it is the same as the package name, but if it's an internal
146 -- library it's a munged combination of the package name and
147 -- the component name.
148 --
149 -- LEGACY ONES
150 --
151 -- InstalledPackageId: This is what we used to call ComponentId.
152 -- It's a still pretty useful concept for packages that have only
153 -- one library; in that case the logical InstalledPackageId =
154 -- ComponentId. Also, the Cabal nix-local-build continues to
155 -- compute an InstalledPackageId which is then forcibly used
156 -- for all components in a package. This means that if a dependency
157 -- from one component in a package changes, the InstalledPackageId
158 -- changes: you don't get as fine-grained dependency tracking,
159 -- but it means your builds are hermetic. Eventually, Cabal will
160 -- deal completely in components and we can get rid of this.
161 --
162 -- PackageKey: This is what we used to call UnitId. We ditched
163 -- "Package" from the name when we realized that you might want to
164 -- assign different "PackageKeys" to components from the same package.
165 -- (For a brief, non-released period of time, we also called these
166 -- UnitKeys).
167
168 {-
169 ************************************************************************
170 * *
171 \subsection{Module locations}
172 * *
173 ************************************************************************
174 -}
175
176 -- | Where a module lives on the file system: the actual locations
177 -- of the .hs, .hi and .o files, if we have them
178 data ModLocation
179 = ModLocation {
180 ml_hs_file :: Maybe FilePath,
181 -- The source file, if we have one. Package modules
182 -- probably don't have source files.
183
184 ml_hi_file :: FilePath,
185 -- Where the .hi file is, whether or not it exists
186 -- yet. Always of form foo.hi, even if there is an
187 -- hi-boot file (we add the -boot suffix later)
188
189 ml_obj_file :: FilePath
190 -- Where the .o file is, whether or not it exists yet.
191 -- (might not exist either because the module hasn't
192 -- been compiled yet, or because it is part of a
193 -- package with a .a file)
194 } deriving Show
195
196 instance Outputable ModLocation where
197 ppr = text . show
198
199 {-
200 For a module in another package, the hs_file and obj_file
201 components of ModLocation are undefined.
202
203 The locations specified by a ModLocation may or may not
204 correspond to actual files yet: for example, even if the object
205 file doesn't exist, the ModLocation still contains the path to
206 where the object file will reside if/when it is created.
207 -}
208
209 addBootSuffix :: FilePath -> FilePath
210 -- ^ Add the @-boot@ suffix to .hs, .hi and .o files
211 addBootSuffix path = path ++ "-boot"
212
213 addBootSuffix_maybe :: Bool -> FilePath -> FilePath
214 -- ^ Add the @-boot@ suffix if the @Bool@ argument is @True@
215 addBootSuffix_maybe is_boot path
216 | is_boot = addBootSuffix path
217 | otherwise = path
218
219 addBootSuffixLocn :: ModLocation -> ModLocation
220 -- ^ Add the @-boot@ suffix to all file paths associated with the module
221 addBootSuffixLocn locn
222 = locn { ml_hs_file = fmap addBootSuffix (ml_hs_file locn)
223 , ml_hi_file = addBootSuffix (ml_hi_file locn)
224 , ml_obj_file = addBootSuffix (ml_obj_file locn) }
225
226 {-
227 ************************************************************************
228 * *
229 \subsection{The name of a module}
230 * *
231 ************************************************************************
232 -}
233
234 -- | A ModuleName is essentially a simple string, e.g. @Data.List@.
235 newtype ModuleName = ModuleName FastString
236 deriving Typeable
237
238 instance Uniquable ModuleName where
239 getUnique (ModuleName nm) = getUnique nm
240
241 instance Eq ModuleName where
242 nm1 == nm2 = getUnique nm1 == getUnique nm2
243
244 -- Warning: gives an ordering relation based on the uniques of the
245 -- FastStrings which are the (encoded) module names. This is _not_
246 -- a lexicographical ordering.
247 instance Ord ModuleName where
248 nm1 `compare` nm2 = getUnique nm1 `compare` getUnique nm2
249
250 instance Outputable ModuleName where
251 ppr = pprModuleName
252
253 instance Binary ModuleName where
254 put_ bh (ModuleName fs) = put_ bh fs
255 get bh = do fs <- get bh; return (ModuleName fs)
256
257 instance BinaryStringRep ModuleName where
258 fromStringRep = mkModuleNameFS . mkFastStringByteString
259 toStringRep = fastStringToByteString . moduleNameFS
260
261 instance Data ModuleName where
262 -- don't traverse?
263 toConstr _ = abstractConstr "ModuleName"
264 gunfold _ _ = error "gunfold"
265 dataTypeOf _ = mkNoRepType "ModuleName"
266
267 stableModuleNameCmp :: ModuleName -> ModuleName -> Ordering
268 -- ^ Compares module names lexically, rather than by their 'Unique's
269 stableModuleNameCmp n1 n2 = moduleNameFS n1 `compare` moduleNameFS n2
270
271 pprModuleName :: ModuleName -> SDoc
272 pprModuleName (ModuleName nm) =
273 getPprStyle $ \ sty ->
274 if codeStyle sty
275 then ztext (zEncodeFS nm)
276 else ftext nm
277
278 moduleNameFS :: ModuleName -> FastString
279 moduleNameFS (ModuleName mod) = mod
280
281 moduleNameString :: ModuleName -> String
282 moduleNameString (ModuleName mod) = unpackFS mod
283
284 -- | Get a string representation of a 'Module' that's unique and stable
285 -- across recompilations.
286 -- eg. "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal"
287 moduleStableString :: Module -> String
288 moduleStableString Module{..} =
289 "$" ++ unitIdString moduleUnitId ++ "$" ++ moduleNameString moduleName
290
291 mkModuleName :: String -> ModuleName
292 mkModuleName s = ModuleName (mkFastString s)
293
294 mkModuleNameFS :: FastString -> ModuleName
295 mkModuleNameFS s = ModuleName s
296
297 -- |Returns the string version of the module name, with dots replaced by slashes.
298 --
299 moduleNameSlashes :: ModuleName -> String
300 moduleNameSlashes = dots_to_slashes . moduleNameString
301 where dots_to_slashes = map (\c -> if c == '.' then pathSeparator else c)
302
303 -- |Returns the string version of the module name, with dots replaced by underscores.
304 --
305 moduleNameColons :: ModuleName -> String
306 moduleNameColons = dots_to_colons . moduleNameString
307 where dots_to_colons = map (\c -> if c == '.' then ':' else c)
308
309 {-
310 ************************************************************************
311 * *
312 \subsection{A fully qualified module}
313 * *
314 ************************************************************************
315 -}
316
317 -- | A Module is a pair of a 'UnitId' and a 'ModuleName'.
318 data Module = Module {
319 moduleUnitId :: !UnitId, -- pkg-1.0
320 moduleName :: !ModuleName -- A.B.C
321 }
322 deriving (Eq, Ord, Typeable)
323
324 instance Uniquable Module where
325 getUnique (Module p n) = getUnique (unitIdFS p `appendFS` moduleNameFS n)
326
327 instance Outputable Module where
328 ppr = pprModule
329
330 instance Binary Module where
331 put_ bh (Module p n) = put_ bh p >> put_ bh n
332 get bh = do p <- get bh; n <- get bh; return (Module p n)
333
334 instance Data Module where
335 -- don't traverse?
336 toConstr _ = abstractConstr "Module"
337 gunfold _ _ = error "gunfold"
338 dataTypeOf _ = mkNoRepType "Module"
339
340 -- | This gives a stable ordering, as opposed to the Ord instance which
341 -- gives an ordering based on the 'Unique's of the components, which may
342 -- not be stable from run to run of the compiler.
343 stableModuleCmp :: Module -> Module -> Ordering
344 stableModuleCmp (Module p1 n1) (Module p2 n2)
345 = (p1 `stableUnitIdCmp` p2) `thenCmp`
346 (n1 `stableModuleNameCmp` n2)
347
348 mkModule :: UnitId -> ModuleName -> Module
349 mkModule = Module
350
351 pprModule :: Module -> SDoc
352 pprModule mod@(Module p n) =
353 pprPackagePrefix p mod <> pprModuleName n
354
355 pprPackagePrefix :: UnitId -> Module -> SDoc
356 pprPackagePrefix p mod = getPprStyle doc
357 where
358 doc sty
359 | codeStyle sty =
360 if p == mainUnitId
361 then empty -- never qualify the main package in code
362 else ztext (zEncodeFS (unitIdFS p)) <> char '_'
363 | qualModule sty mod = ppr (moduleUnitId mod) <> char ':'
364 -- the PrintUnqualified tells us which modules have to
365 -- be qualified with package names
366 | otherwise = empty
367
368 class ContainsModule t where
369 extractModule :: t -> Module
370
371 class HasModule m where
372 getModule :: m Module
373
374 {-
375 ************************************************************************
376 * *
377 \subsection{UnitId}
378 * *
379 ************************************************************************
380 -}
381
382 -- | A string which uniquely identifies a package. For wired-in packages,
383 -- it is just the package name, but for user compiled packages, it is a hash.
384 -- ToDo: when the key is a hash, we can do more clever things than store
385 -- the hex representation and hash-cons those strings.
386 newtype UnitId = PId FastString deriving( Eq, Typeable )
387 -- here to avoid module loops with PackageConfig
388
389 instance Uniquable UnitId where
390 getUnique pid = getUnique (unitIdFS pid)
391
392 -- Note: *not* a stable lexicographic ordering, a faster unique-based
393 -- ordering.
394 instance Ord UnitId where
395 nm1 `compare` nm2 = getUnique nm1 `compare` getUnique nm2
396
397 instance Data UnitId where
398 -- don't traverse?
399 toConstr _ = abstractConstr "UnitId"
400 gunfold _ _ = error "gunfold"
401 dataTypeOf _ = mkNoRepType "UnitId"
402
403 stableUnitIdCmp :: UnitId -> UnitId -> Ordering
404 -- ^ Compares package ids lexically, rather than by their 'Unique's
405 stableUnitIdCmp p1 p2 = unitIdFS p1 `compare` unitIdFS p2
406
407 instance Outputable UnitId where
408 ppr pk = getPprStyle $ \sty -> sdocWithDynFlags $ \dflags ->
409 case unitIdPackageIdString dflags pk of
410 Nothing -> ftext (unitIdFS pk)
411 Just pkg -> text pkg
412 -- Don't bother qualifying if it's wired in!
413 <> (if qualPackage sty pk && not (pk `elem` wiredInUnitIds)
414 then char '@' <> ftext (unitIdFS pk)
415 else empty)
416
417 instance Binary UnitId where
418 put_ bh pid = put_ bh (unitIdFS pid)
419 get bh = do { fs <- get bh; return (fsToUnitId fs) }
420
421 instance BinaryStringRep UnitId where
422 fromStringRep = fsToUnitId . mkFastStringByteString
423 toStringRep = fastStringToByteString . unitIdFS
424
425 fsToUnitId :: FastString -> UnitId
426 fsToUnitId = PId
427
428 unitIdFS :: UnitId -> FastString
429 unitIdFS (PId fs) = fs
430
431 stringToUnitId :: String -> UnitId
432 stringToUnitId = fsToUnitId . mkFastString
433
434 unitIdString :: UnitId -> String
435 unitIdString = unpackFS . unitIdFS
436
437
438 -- -----------------------------------------------------------------------------
439 -- $wired_in_packages
440 -- Certain packages are known to the compiler, in that we know about certain
441 -- entities that reside in these packages, and the compiler needs to
442 -- declare static Modules and Names that refer to these packages. Hence
443 -- the wired-in packages can't include version numbers, since we don't want
444 -- to bake the version numbers of these packages into GHC.
445 --
446 -- So here's the plan. Wired-in packages are still versioned as
447 -- normal in the packages database, and you can still have multiple
448 -- versions of them installed. However, for each invocation of GHC,
449 -- only a single instance of each wired-in package will be recognised
450 -- (the desired one is selected via @-package@\/@-hide-package@), and GHC
451 -- will use the unversioned 'UnitId' below when referring to it,
452 -- including in .hi files and object file symbols. Unselected
453 -- versions of wired-in packages will be ignored, as will any other
454 -- package that depends directly or indirectly on it (much as if you
455 -- had used @-ignore-package@).
456
457 -- Make sure you change 'Packages.findWiredInPackages' if you add an entry here
458
459 integerUnitId, primUnitId,
460 baseUnitId, rtsUnitId,
461 thUnitId, dphSeqUnitId, dphParUnitId,
462 mainUnitId, thisGhcUnitId, interactiveUnitId :: UnitId
463 primUnitId = fsToUnitId (fsLit "ghc-prim")
464 integerUnitId = fsToUnitId (fsLit n)
465 where
466 n = case cIntegerLibraryType of
467 IntegerGMP -> "integer-gmp"
468 IntegerSimple -> "integer-simple"
469 baseUnitId = fsToUnitId (fsLit "base")
470 rtsUnitId = fsToUnitId (fsLit "rts")
471 thUnitId = fsToUnitId (fsLit "template-haskell")
472 dphSeqUnitId = fsToUnitId (fsLit "dph-seq")
473 dphParUnitId = fsToUnitId (fsLit "dph-par")
474 thisGhcUnitId = fsToUnitId (fsLit "ghc")
475 interactiveUnitId = fsToUnitId (fsLit "interactive")
476
477 -- | This is the package Id for the current program. It is the default
478 -- package Id if you don't specify a package name. We don't add this prefix
479 -- to symbol names, since there can be only one main package per program.
480 mainUnitId = fsToUnitId (fsLit "main")
481
482 -- | This is a fake package id used to provide identities to any un-implemented
483 -- signatures. The set of hole identities is global over an entire compilation.
484 holeUnitId :: UnitId
485 holeUnitId = fsToUnitId (fsLit "hole")
486
487 isInteractiveModule :: Module -> Bool
488 isInteractiveModule mod = moduleUnitId mod == interactiveUnitId
489
490 isHoleModule :: Module -> Bool
491 isHoleModule mod = moduleUnitId mod == holeUnitId
492
493 wiredInUnitIds :: [UnitId]
494 wiredInUnitIds = [ primUnitId,
495 integerUnitId,
496 baseUnitId,
497 rtsUnitId,
498 thUnitId,
499 thisGhcUnitId,
500 dphSeqUnitId,
501 dphParUnitId ]
502
503 {-
504 ************************************************************************
505 * *
506 \subsection{@ModuleEnv@s}
507 * *
508 ************************************************************************
509 -}
510
511 -- | A map keyed off of 'Module's
512 newtype ModuleEnv elt = ModuleEnv (Map Module elt)
513
514 filterModuleEnv :: (Module -> a -> Bool) -> ModuleEnv a -> ModuleEnv a
515 filterModuleEnv f (ModuleEnv e) = ModuleEnv (Map.filterWithKey f e)
516
517 elemModuleEnv :: Module -> ModuleEnv a -> Bool
518 elemModuleEnv m (ModuleEnv e) = Map.member m e
519
520 extendModuleEnv :: ModuleEnv a -> Module -> a -> ModuleEnv a
521 extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert m x e)
522
523 extendModuleEnvWith :: (a -> a -> a) -> ModuleEnv a -> Module -> a -> ModuleEnv a
524 extendModuleEnvWith f (ModuleEnv e) m x = ModuleEnv (Map.insertWith f m x e)
525
526 extendModuleEnvList :: ModuleEnv a -> [(Module, a)] -> ModuleEnv a
527 extendModuleEnvList (ModuleEnv e) xs = ModuleEnv (Map.insertList xs e)
528
529 extendModuleEnvList_C :: (a -> a -> a) -> ModuleEnv a -> [(Module, a)]
530 -> ModuleEnv a
531 extendModuleEnvList_C f (ModuleEnv e) xs = ModuleEnv (Map.insertListWith f xs e)
532
533 plusModuleEnv_C :: (a -> a -> a) -> ModuleEnv a -> ModuleEnv a -> ModuleEnv a
534 plusModuleEnv_C f (ModuleEnv e1) (ModuleEnv e2) = ModuleEnv (Map.unionWith f e1 e2)
535
536 delModuleEnvList :: ModuleEnv a -> [Module] -> ModuleEnv a
537 delModuleEnvList (ModuleEnv e) ms = ModuleEnv (Map.deleteList ms e)
538
539 delModuleEnv :: ModuleEnv a -> Module -> ModuleEnv a
540 delModuleEnv (ModuleEnv e) m = ModuleEnv (Map.delete m e)
541
542 plusModuleEnv :: ModuleEnv a -> ModuleEnv a -> ModuleEnv a
543 plusModuleEnv (ModuleEnv e1) (ModuleEnv e2) = ModuleEnv (Map.union e1 e2)
544
545 lookupModuleEnv :: ModuleEnv a -> Module -> Maybe a
546 lookupModuleEnv (ModuleEnv e) m = Map.lookup m e
547
548 lookupWithDefaultModuleEnv :: ModuleEnv a -> a -> Module -> a
549 lookupWithDefaultModuleEnv (ModuleEnv e) x m = Map.findWithDefault x m e
550
551 mapModuleEnv :: (a -> b) -> ModuleEnv a -> ModuleEnv b
552 mapModuleEnv f (ModuleEnv e) = ModuleEnv (Map.mapWithKey (\_ v -> f v) e)
553
554 mkModuleEnv :: [(Module, a)] -> ModuleEnv a
555 mkModuleEnv xs = ModuleEnv (Map.fromList xs)
556
557 emptyModuleEnv :: ModuleEnv a
558 emptyModuleEnv = ModuleEnv Map.empty
559
560 moduleEnvKeys :: ModuleEnv a -> [Module]
561 moduleEnvKeys (ModuleEnv e) = Map.keys e
562
563 moduleEnvElts :: ModuleEnv a -> [a]
564 moduleEnvElts (ModuleEnv e) = Map.elems e
565
566 moduleEnvToList :: ModuleEnv a -> [(Module, a)]
567 moduleEnvToList (ModuleEnv e) = Map.toList e
568
569 unitModuleEnv :: Module -> a -> ModuleEnv a
570 unitModuleEnv m x = ModuleEnv (Map.singleton m x)
571
572 isEmptyModuleEnv :: ModuleEnv a -> Bool
573 isEmptyModuleEnv (ModuleEnv e) = Map.null e
574
575 foldModuleEnv :: (a -> b -> b) -> b -> ModuleEnv a -> b
576 foldModuleEnv f x (ModuleEnv e) = Map.foldRightWithKey (\_ v -> f v) x e
577
578 -- | A set of 'Module's
579 type ModuleSet = Map Module ()
580
581 mkModuleSet :: [Module] -> ModuleSet
582 extendModuleSet :: ModuleSet -> Module -> ModuleSet
583 emptyModuleSet :: ModuleSet
584 moduleSetElts :: ModuleSet -> [Module]
585 elemModuleSet :: Module -> ModuleSet -> Bool
586
587 emptyModuleSet = Map.empty
588 mkModuleSet ms = Map.fromList [(m,()) | m <- ms ]
589 extendModuleSet s m = Map.insert m () s
590 moduleSetElts = Map.keys
591 elemModuleSet = Map.member
592
593 {-
594 A ModuleName has a Unique, so we can build mappings of these using
595 UniqFM.
596 -}
597
598 -- | A map keyed off of 'ModuleName's (actually, their 'Unique's)
599 type ModuleNameEnv elt = UniqFM elt