2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
4 \section[RnMonad]{The monad used by the renamer}
10 module RdrName, -- Re-exports
11 module Name, -- from these two
24 #include "HsVersions.h"
26 #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 405
27 import IOExts ( fixIO )
28 #elif defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 302
29 import PrelIOBase ( fixIO ) -- Should be in GlaExts
31 import IOBase ( fixIO )
33 import IOExts ( IORef, newIORef, readIORef, writeIORef, unsafePerformIO )
37 import RnHsSyn ( RenamedFixitySig, RenamedDeprecation )
38 import BasicTypes ( Version, defaultFixity )
39 import SrcLoc ( noSrcLoc )
40 import ErrUtils ( addShortErrLocLine, addShortWarnLocLine,
41 pprBagOfErrors, ErrMsg, WarnMsg, Message
43 import RdrName ( RdrName, dummyRdrVarName, rdrNameOcc,
44 RdrNameEnv, emptyRdrEnv, extendRdrEnv,
45 lookupRdrEnv, addListToRdrEnv, rdrEnvToList, rdrEnvElts
47 import Name ( Name, OccName, NamedThing(..), getSrcLoc,
48 isLocallyDefinedName, nameModule, nameOccName,
49 decode, mkLocalName, mkUnboundName,
50 NameEnv, lookupNameEnv, emptyNameEnv, unitNameEnv, extendNameEnv,
51 addToNameEnv_C, plusNameEnv_C, nameEnvElts,
52 elemNameEnv, addToNameEnv, addListToNameEnv
54 import Module ( Module, ModuleName, ModuleHiMap, SearchPath, WhereFrom,
55 mkModuleHiMaps, moduleName, mkSearchPath
58 import CmdLineOpts ( opt_D_dump_rn_trace, opt_HiMap )
59 import PrelInfo ( builtinNames )
60 import TysWiredIn ( boolTyCon )
61 import SrcLoc ( SrcLoc, mkGeneratedSrcLoc )
62 import Unique ( Unique, getUnique, unboundKey )
63 import FiniteMap ( FiniteMap, emptyFM, bagToFM, lookupFM, addToFM, addListToFM,
64 addListToFM_C, addToFM_C, eltsFM, fmToList
66 import Bag ( Bag, mapBag, emptyBag, isEmptyBag, snocBag )
67 import Maybes ( mapMaybe )
73 infixr 9 `thenRn`, `thenRn_`
77 %************************************************************************
79 \subsection{Somewhat magical interface to other monads}
81 %************************************************************************
84 ioToRnM :: IO r -> RnM d (Either IOError r)
85 ioToRnM io rn_down g_down = (io >>= \ ok -> return (Right ok))
87 (\ err -> return (Left err))
89 traceRn :: SDoc -> RnM d ()
90 traceRn msg | opt_D_dump_rn_trace = putDocRn msg
91 | otherwise = returnRn ()
93 putDocRn :: SDoc -> RnM d ()
94 putDocRn msg = ioToRnM (printErrs msg) `thenRn_`
99 %************************************************************************
101 \subsection{Data types}
103 %************************************************************************
105 %===================================================
106 \subsubsection{ MONAD TYPES}
107 %===================================================
110 type RnM d r = RnDown -> d -> IO r
111 type RnMS r = RnM SDown r -- Renaming source
112 type RnMG r = RnM () r -- Getting global names etc
115 data RnDown = RnDown {
116 rn_mod :: ModuleName,
118 rn_ns :: IORef RnNameSupply,
119 rn_errs :: IORef (Bag WarnMsg, Bag ErrMsg),
120 rn_ifaces :: IORef Ifaces,
121 rn_hi_maps :: (SearchPath, -- For error messages
122 ModuleHiMap, -- for .hi files
123 ModuleHiMap) -- for .hi-boot files
126 -- For renaming source code
130 rn_genv :: GlobalRdrEnv,
131 -- Global envt; the fixity component gets extended
132 -- with local fixity decls
134 rn_lenv :: LocalRdrEnv, -- Local name envt
135 -- Does *not* include global name envt; may shadow it
136 -- Includes both ordinary variables and type variables;
137 -- they are kept distinct because tyvar have a different
138 -- occurrence contructor (Name.TvOcc)
139 -- We still need the unsullied global name env so that
140 -- we can look up record field names
142 rn_fixenv :: FixityEnv -- Local fixities
143 -- The global fixities are held in the
144 -- rn_ifaces field. Why? See the comments
145 -- with RnIfaces.lookupFixity
148 data RnMode = SourceMode -- Renaming source code
149 | InterfaceMode -- Renaming interface declarations.
152 %===================================================
153 \subsubsection{ ENVIRONMENTS}
154 %===================================================
157 --------------------------------
158 type GlobalRdrEnv = RdrNameEnv [Name] -- The list is because there may be name clashes
159 -- These only get reported on lookup,
160 -- not on construction
161 type LocalRdrEnv = RdrNameEnv Name
163 --------------------------------
164 type FixityEnv = NameEnv RenamedFixitySig
165 -- We keep the whole fixity sig so that we
166 -- can report line-number info when there is a duplicate
167 -- fixity declaration
169 lookupFixity :: FixityEnv -> Name -> Fixity
170 lookupFixity env name
171 = case lookupNameEnv env name of
172 Just (FixitySig _ fix _) -> fix
173 Nothing -> defaultFixity
175 --------------------------------
176 type DeprecationEnv = NameEnv DeprecTxt
180 --------------------------------
184 , FiniteMap String Int
185 -- This is used as a name supply for dictionary functions
186 -- From the inst decl we derive a string, usually by glomming together
187 -- the class and tycon name -- but it doesn't matter exactly how;
188 -- this map then gives a unique int for each inst decl with that
189 -- string. (In Haskell 98 there can only be one,
190 -- but not so in more extended versions; also class CC type T
191 -- and class C type TT might both give the string CCT
193 -- We could just use one Int for all the instance decls, but this
194 -- way the uniques change less when you add an instance decl,
195 -- hence less recompilation
197 , FiniteMap (ModuleName, OccName) Name
198 -- Ensures that one (module,occname) pair gets one unique
199 , FiniteMap OccName Name
200 -- Ensures that one implicit parameter name gets one unique
204 --------------------------------
205 type Avails = [AvailInfo]
207 type ExportAvails = (FiniteMap ModuleName Avails,
208 -- Used to figure out "module M" export specifiers
209 -- Includes avails only from *unqualified* imports
210 -- (see 1.4 Report Section 5.1.1)
212 AvailEnv) -- Used to figure out all other export specifiers.
215 data GenAvailInfo name = Avail name -- An ordinary identifier
216 | AvailTC name -- The name of the type or class
217 [name] -- The available pieces of type/class.
218 -- NB: If the type or class is itself
219 -- to be in scope, it must be in this list.
220 -- Thus, typically: AvailTC Eq [Eq, ==, /=]
222 -- Equality used when deciding if the interface has changed
224 type AvailEnv = NameEnv AvailInfo -- Maps a Name to the AvailInfo that contains it
225 type AvailInfo = GenAvailInfo Name
226 type RdrAvailInfo = GenAvailInfo OccName
229 %===================================================
230 \subsubsection{ INTERFACE FILE STUFF}
231 %===================================================
234 type ExportItem = (ModuleName, [RdrAvailInfo])
236 type ImportVersion name = (ModuleName, WhetherHasOrphans, IsBootInterface, WhatsImported name)
238 type ModVersionInfo = (Version, -- Version of the whole module
239 Version, -- Version number for all fixity decls together
240 Version) -- ...ditto all rules together
242 type WhetherHasOrphans = Bool
244 -- * an instance decl in a module other than the defn module for
245 -- one of the tycons or classes in the instance head
246 -- * a transformation rule in a module other than the one defining
247 -- the function in the head of the rule.
249 type IsBootInterface = Bool
251 data WhatsImported name = NothingAtAll -- The module is below us in the
252 -- hierarchy, but we import nothing
254 | Everything Version -- The module version
256 | Specifically Version -- Module version
257 Version -- Fixity version
258 Version -- Rules version
259 [(name,Version)] -- List guaranteed non-empty
261 -- 'Specifically' doesn't let you say "I imported f but none of the fixities in
262 -- the module. If you use anything in the module you get its fixity and rule version
263 -- So if the fixities or rules change, you'll recompile, even if you don't use either.
264 -- This is easy to implement, and it's safer: you might not have used the rules last
265 -- time round, but if someone has added a new rule you might need it this time
267 -- 'Everything' means there was a "module M" in
268 -- this module's export list, so we just have to go by M's version,
269 -- not the list of (name,version) pairs
273 pi_mod :: Module, -- Complete with package info
274 pi_vers :: Version, -- Module version number
275 pi_orphan :: WhetherHasOrphans, -- Whether this module has orphans
276 pi_usages :: [ImportVersion OccName], -- Usages
277 pi_exports :: [ExportItem], -- Exports
278 pi_insts :: [RdrNameInstDecl], -- Local instance declarations
279 pi_decls :: [(Version, RdrNameHsDecl)], -- Local definitions
280 pi_fixity :: (Version, [RdrNameFixitySig]), -- Local fixity declarations, with their version
281 pi_rules :: (Version, [RdrNameRuleDecl]), -- Rules, with their version
282 pi_deprecs :: [RdrNameDeprecation] -- Deprecations
286 type RdrNamePragma = () -- Fudge for now
289 data Ifaces = Ifaces {
290 iImpModInfo :: ImportedModuleInfo,
291 -- Modules this one depends on: that is, the union
292 -- of the modules its *direct* imports depend on.
293 -- NB: The direct imports have .hi files that enumerate *all* the
294 -- dependencies (direct or not) of the imported module.
296 iDecls :: DeclsMap, -- A single, global map of Names to decls
298 iDeferred :: NameSet, -- data (not newtype) TyCons that have been slurped,
299 -- but none of their constructors have.
300 -- If this is still the case right at the end
301 -- we can get away with importing them abstractly
304 -- A single, global map of Names to fixities
305 -- See comments with RnIfaces.lookupFixity
308 -- All the names (whether "big" or "small", whether wired-in or not,
309 -- whether locally defined or not) that have been slurped in so far.
311 iVSlurp :: [(Name,Version)],
312 -- All the (a) non-wired-in (b) "big" (c) non-locally-defined
313 -- names that have been slurped in so far, with their versions.
314 -- This is used to generate the "usage" information for this module.
315 -- Subset of the previous field.
317 iInsts :: Bag GatedDecl,
318 -- The as-yet un-slurped instance decls; this bag is depleted when we
319 -- slurp an instance decl so that we don't slurp the same one twice.
320 -- Each is 'gated' by the names that must be available before
321 -- this instance decl is needed.
323 iRules :: IfaceRules,
324 -- Similar to instance decls, except that we track the version number of the
325 -- rules we import from each module
326 -- [We keep just one rule-version number for each module]
327 -- The Bool is True if we import any rules at all from that module
329 iDeprecs :: DeprecationEnv
332 type IfaceRules = Bag GatedDecl
334 type GatedDecl = (NameSet, (Module, RdrNameHsDecl))
336 type ImportedModuleInfo
337 = FiniteMap ModuleName (WhetherHasOrphans, IsBootInterface,
338 Maybe (Module, Version, Version, Version, WhereFrom, Avails))
339 -- The three Versions are module version, fixity version, rules version
341 -- Suppose the domain element is module 'A'
343 -- The first Bool is True if A contains
344 -- 'orphan' rules or instance decls
346 -- The second Bool is true if the interface file actually
347 -- read was an .hi-boot file
349 -- Nothing => A's interface not yet read, but this module has
350 -- imported a module, B, that itself depends on A
352 -- Just xx => A's interface has been read. The Module in
353 -- the Just has the correct Dll flag
355 -- This set is used to decide whether to look for
356 -- A.hi or A.hi-boot when importing A.f.
357 -- Basically, we look for A.hi if A is in the map, and A.hi-boot
360 type DeclsMap = NameEnv (Version, AvailInfo, Bool, (Module, RdrNameHsDecl))
361 -- A DeclsMap contains a binding for each Name in the declaration
362 -- including the constructors of a type decl etc.
363 -- The Bool is True just for the 'main' Name.
367 %************************************************************************
369 \subsection{Main monad code}
371 %************************************************************************
374 initRn :: ModuleName -> UniqSupply -> SearchPath -> SrcLoc
376 -> IO (r, Bag ErrMsg, Bag WarnMsg)
378 initRn mod us dirs loc do_rn = do
379 himaps <- mkModuleHiMaps dirs
380 names_var <- newIORef (us, emptyFM, builtins, emptyFM)
381 errs_var <- newIORef (emptyBag,emptyBag)
382 iface_var <- newIORef emptyIfaces
384 rn_down = RnDown { rn_loc = loc, rn_ns = names_var,
387 rn_ifaces = iface_var,
391 res <- do_rn rn_down ()
393 -- grab errors and return
394 (warns, errs) <- readIORef errs_var
396 return (res, errs, warns)
399 initRnMS :: GlobalRdrEnv -> FixityEnv -> RnMode -> RnMS r -> RnM d r
400 initRnMS rn_env fixity_env mode thing_inside rn_down g_down
402 s_down = SDown { rn_genv = rn_env, rn_lenv = emptyRdrEnv,
403 rn_fixenv = fixity_env, rn_mode = mode }
405 thing_inside rn_down s_down
407 initIfaceRnMS :: Module -> RnMS r -> RnM d r
408 initIfaceRnMS mod thing_inside
409 = initRnMS emptyRdrEnv emptyNameEnv InterfaceMode $
410 setModuleRn (moduleName mod) thing_inside
412 emptyIfaces :: Ifaces
413 emptyIfaces = Ifaces { iImpModInfo = emptyFM,
414 iDecls = emptyNameEnv,
415 iDeferred = emptyNameSet,
416 iFixes = emptyNameEnv,
417 iSlurp = unitNameSet (mkUnboundName dummyRdrVarName),
418 -- Pretend that the dummy unbound name has already been
419 -- slurped. This is what's returned for an out-of-scope name,
420 -- and we don't want thereby to try to suck it in!
424 iDeprecs = emptyNameEnv
427 builtins :: FiniteMap (ModuleName,OccName) Name
430 mapBag (\ name -> ((moduleName (nameModule name), nameOccName name), name))
434 @renameSourceCode@ is used to rename stuff ``out-of-line'';
435 that is, not as part of the main renamer.
436 Sole examples: derived definitions,
437 which are only generated in the type checker.
439 The @RnNameSupply@ includes a @UniqueSupply@, so if you call it more than
440 once you must either split it, or install a fresh unique supply.
443 renameSourceCode :: ModuleName
448 renameSourceCode mod_name name_supply m
450 -- It's not really unsafe! When renaming source code we
451 -- only do any I/O if we need to read in a fixity declaration;
452 -- and that doesn't happen in pragmas etc
454 mkModuleHiMaps (mkSearchPath opt_HiMap) >>= \ himaps ->
455 newIORef name_supply >>= \ names_var ->
456 newIORef (emptyBag,emptyBag) >>= \ errs_var ->
458 rn_down = RnDown { rn_loc = mkGeneratedSrcLoc, rn_ns = names_var,
459 rn_errs = errs_var, rn_hi_maps = himaps,
461 rn_ifaces = panic "rnameSourceCode: rn_ifaces" -- Not required
463 s_down = SDown { rn_mode = InterfaceMode,
464 -- So that we can refer to PrelBase.True etc
465 rn_genv = emptyRdrEnv, rn_lenv = emptyRdrEnv,
466 rn_fixenv = emptyNameEnv }
468 m rn_down s_down >>= \ result ->
470 readIORef errs_var >>= \ (warns,errs) ->
472 (if not (isEmptyBag errs) then
473 pprTrace "Urk! renameSourceCode found errors" (display errs)
475 else if not (isEmptyBag warns) then
476 pprTrace "Note: renameSourceCode found warnings" (display warns)
484 display errs = pprBagOfErrors errs
486 {-# INLINE thenRn #-}
487 {-# INLINE thenRn_ #-}
488 {-# INLINE returnRn #-}
491 returnRn :: a -> RnM d a
492 thenRn :: RnM d a -> (a -> RnM d b) -> RnM d b
493 thenRn_ :: RnM d a -> RnM d b -> RnM d b
494 andRn :: (a -> a -> a) -> RnM d a -> RnM d a -> RnM d a
495 mapRn :: (a -> RnM d b) -> [a] -> RnM d [b]
496 mapRn_ :: (a -> RnM d b) -> [a] -> RnM d ()
497 mapMaybeRn :: (a -> RnM d (Maybe b)) -> [a] -> RnM d [b]
498 flatMapRn :: (a -> RnM d [b]) -> [a] -> RnM d [b]
499 sequenceRn :: [RnM d a] -> RnM d [a]
500 foldlRn :: (b -> a -> RnM d b) -> b -> [a] -> RnM d b
501 mapAndUnzipRn :: (a -> RnM d (b,c)) -> [a] -> RnM d ([b],[c])
502 fixRn :: (a -> RnM d a) -> RnM d a
504 returnRn v gdown ldown = return v
505 thenRn m k gdown ldown = m gdown ldown >>= \ r -> k r gdown ldown
506 thenRn_ m k gdown ldown = m gdown ldown >> k gdown ldown
507 fixRn m gdown ldown = fixIO (\r -> m r gdown ldown)
508 andRn combiner m1 m2 gdown ldown
509 = m1 gdown ldown >>= \ res1 ->
510 m2 gdown ldown >>= \ res2 ->
511 return (combiner res1 res2)
513 sequenceRn [] = returnRn []
514 sequenceRn (m:ms) = m `thenRn` \ r ->
515 sequenceRn ms `thenRn` \ rs ->
518 mapRn f [] = returnRn []
520 = f x `thenRn` \ r ->
521 mapRn f xs `thenRn` \ rs ->
524 mapRn_ f [] = returnRn ()
529 foldlRn k z [] = returnRn z
530 foldlRn k z (x:xs) = k z x `thenRn` \ z' ->
533 mapAndUnzipRn f [] = returnRn ([],[])
534 mapAndUnzipRn f (x:xs)
535 = f x `thenRn` \ (r1, r2) ->
536 mapAndUnzipRn f xs `thenRn` \ (rs1, rs2) ->
537 returnRn (r1:rs1, r2:rs2)
539 mapAndUnzip3Rn f [] = returnRn ([],[],[])
540 mapAndUnzip3Rn f (x:xs)
541 = f x `thenRn` \ (r1, r2, r3) ->
542 mapAndUnzip3Rn f xs `thenRn` \ (rs1, rs2, rs3) ->
543 returnRn (r1:rs1, r2:rs2, r3:rs3)
545 mapMaybeRn f [] = returnRn []
546 mapMaybeRn f (x:xs) = f x `thenRn` \ maybe_r ->
547 mapMaybeRn f xs `thenRn` \ rs ->
549 Nothing -> returnRn rs
550 Just r -> returnRn (r:rs)
552 flatMapRn f [] = returnRn []
553 flatMapRn f (x:xs) = f x `thenRn` \ r ->
554 flatMapRn f xs `thenRn` \ rs ->
560 %************************************************************************
562 \subsection{Boring plumbing for common part}
564 %************************************************************************
568 \subsubsection{ Errors and warnings}
569 %=====================
572 failWithRn :: a -> Message -> RnM d a
573 failWithRn res msg (RnDown {rn_errs = errs_var, rn_loc = loc}) l_down
574 = readIORef errs_var >>= \ (warns,errs) ->
575 writeIORef errs_var (warns, errs `snocBag` err) >>
578 err = addShortErrLocLine loc msg
580 warnWithRn :: a -> Message -> RnM d a
581 warnWithRn res msg (RnDown {rn_errs = errs_var, rn_loc = loc}) l_down
582 = readIORef errs_var >>= \ (warns,errs) ->
583 writeIORef errs_var (warns `snocBag` warn, errs) >>
586 warn = addShortWarnLocLine loc msg
588 addErrRn :: Message -> RnM d ()
589 addErrRn err = failWithRn () err
591 checkRn :: Bool -> Message -> RnM d () -- Check that a condition is true
592 checkRn False err = addErrRn err
593 checkRn True err = returnRn ()
595 warnCheckRn :: Bool -> Message -> RnM d () -- Check that a condition is true
596 warnCheckRn False err = addWarnRn err
597 warnCheckRn True err = returnRn ()
599 addWarnRn :: Message -> RnM d ()
600 addWarnRn warn = warnWithRn () warn
602 checkErrsRn :: RnM d Bool -- True <=> no errors so far
603 checkErrsRn (RnDown {rn_errs = errs_var}) l_down
604 = readIORef errs_var >>= \ (warns,errs) ->
605 return (isEmptyBag errs)
610 \subsubsection{ Source location}
611 %=====================
614 pushSrcLocRn :: SrcLoc -> RnM d a -> RnM d a
615 pushSrcLocRn loc' m down l_down
616 = m (down {rn_loc = loc'}) l_down
618 getSrcLocRn :: RnM d SrcLoc
619 getSrcLocRn down l_down
620 = return (rn_loc down)
624 \subsubsection{ Name supply}
625 %=====================
628 getNameSupplyRn :: RnM d RnNameSupply
629 getNameSupplyRn rn_down l_down
630 = readIORef (rn_ns rn_down)
632 setNameSupplyRn :: RnNameSupply -> RnM d ()
633 setNameSupplyRn names' (RnDown {rn_ns = names_var}) l_down
634 = writeIORef names_var names'
636 -- See comments with RnNameSupply above.
637 newInstUniq :: String -> RnM d Int
638 newInstUniq key (RnDown {rn_ns = names_var}) l_down
639 = readIORef names_var >>= \ (us, mapInst, cache, ipcache) ->
641 uniq = case lookupFM mapInst key of
644 mapInst' = addToFM mapInst key uniq
646 writeIORef names_var (us, mapInst', cache, ipcache) >>
649 getUniqRn :: RnM d Unique
650 getUniqRn (RnDown {rn_ns = names_var}) l_down
651 = readIORef names_var >>= \ (us, mapInst, cache, ipcache) ->
653 (us1,us') = splitUniqSupply us
655 writeIORef names_var (us', mapInst, cache, ipcache) >>
656 return (uniqFromSupply us1)
660 \subsubsection{ Module}
661 %=====================
664 getModuleRn :: RnM d ModuleName
665 getModuleRn (RnDown {rn_mod = mod_name}) l_down
668 setModuleRn :: ModuleName -> RnM d a -> RnM d a
669 setModuleRn new_mod enclosed_thing rn_down l_down
670 = enclosed_thing (rn_down {rn_mod = new_mod}) l_down
674 %************************************************************************
676 \subsection{Plumbing for rename-source part}
678 %************************************************************************
681 \subsubsection{ RnEnv}
682 %=====================
685 getNameEnvs :: RnMS (GlobalRdrEnv, LocalRdrEnv)
686 getNameEnvs rn_down (SDown {rn_genv = global_env, rn_lenv = local_env})
687 = return (global_env, local_env)
689 getLocalNameEnv :: RnMS LocalRdrEnv
690 getLocalNameEnv rn_down (SDown {rn_lenv = local_env})
693 setLocalNameEnv :: LocalRdrEnv -> RnMS a -> RnMS a
694 setLocalNameEnv local_env' m rn_down l_down
695 = m rn_down (l_down {rn_lenv = local_env'})
697 getFixityEnv :: RnMS FixityEnv
698 getFixityEnv rn_down (SDown {rn_fixenv = fixity_env})
701 extendFixityEnv :: [(Name, RenamedFixitySig)] -> RnMS a -> RnMS a
702 extendFixityEnv fixes enclosed_scope
703 rn_down l_down@(SDown {rn_fixenv = fixity_env})
705 new_fixity_env = extendNameEnv fixity_env fixes
707 enclosed_scope rn_down (l_down {rn_fixenv = new_fixity_env})
711 \subsubsection{ Mode}
712 %=====================
715 getModeRn :: RnMS RnMode
716 getModeRn rn_down (SDown {rn_mode = mode})
719 setModeRn :: RnMode -> RnMS a -> RnMS a
720 setModeRn new_mode thing_inside rn_down l_down
721 = thing_inside rn_down (l_down {rn_mode = new_mode})
725 %************************************************************************
727 \subsection{Plumbing for rename-globals part}
729 %************************************************************************
732 getIfacesRn :: RnM d Ifaces
733 getIfacesRn (RnDown {rn_ifaces = iface_var}) _
734 = readIORef iface_var
736 setIfacesRn :: Ifaces -> RnM d ()
737 setIfacesRn ifaces (RnDown {rn_ifaces = iface_var}) _
738 = writeIORef iface_var ifaces
740 getHiMaps :: RnM d (SearchPath, ModuleHiMap, ModuleHiMap)
741 getHiMaps (RnDown {rn_hi_maps = himaps}) _