2 % (c) The University of Glasgow 2006
3 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
6 Loading interface files
10 loadInterface, loadInterfaceForName, loadWiredInHomeIface,
11 loadSrcInterface, loadSysInterface, loadOrphanModules,
12 findAndReadIface, readIface, -- Used when reading the module's old interface
13 loadDecls, -- Should move to TcIface and be renamed
14 initExternalPackageState,
16 ifaceStats, pprModIface, showIface
19 #include "HsVersions.h"
21 import {-# SOURCE #-} TcIface( tcIfaceDecl, tcIfaceRules, tcIfaceInst,
22 tcIfaceFamInst, tcIfaceVectInfo )
29 import BasicTypes hiding (SuccessFlag(..))
60 %************************************************************************
62 loadSrcInterface, loadOrphanModules, loadHomeInterface
64 These three are called from TcM-land
66 %************************************************************************
69 -- | Load the interface corresponding to an @import@ directive in
70 -- source code. On a failure, fail in the monad with an error message.
71 loadSrcInterface :: SDoc -> ModuleName -> IsBootInterface -> RnM ModIface
72 loadSrcInterface doc mod want_boot = do
73 -- We must first find which Module this import refers to. This involves
74 -- calling the Finder, which as a side effect will search the filesystem
75 -- and create a ModLocation. If successful, loadIface will read the
76 -- interface; it will call the Finder again, but the ModLocation will be
77 -- cached from the first search.
79 res <- ioToIOEnv $ findImportedModule hsc_env mod Nothing
82 mb_iface <- initIfaceTcRn $ loadInterface doc mod (ImportByUser want_boot)
84 Failed err -> failWithTc err
85 Succeeded iface -> return iface
87 let dflags = hsc_dflags hsc_env in
88 failWithTc (cannotFindInterface dflags mod err)
90 -- | Load interfaces for a collection of orphan modules.
91 loadOrphanModules :: [Module] -- the modules
92 -> Bool -- these are family instance-modules
94 loadOrphanModules mods isFamInstMod
95 | null mods = returnM ()
96 | otherwise = initIfaceTcRn $
97 do { traceIf (text "Loading orphan modules:" <+>
102 load mod = loadSysInterface (mk_doc mod) mod
104 | isFamInstMod = ppr mod <+> ptext SLIT("is a family-instance module")
105 | otherwise = ppr mod <+> ptext SLIT("is a orphan-instance module")
107 -- | Loads the interface for a given Name.
108 loadInterfaceForName :: SDoc -> Name -> TcRn ModIface
109 loadInterfaceForName doc name
112 -- Should not be called with a name from the module being compiled
113 this_mod <- getModule
114 ; ASSERT2( not (nameIsLocalOrFrom this_mod name), ppr name <+> parens doc )
116 initIfaceTcRn $ loadSysInterface doc (nameModule name)
119 -- | An 'IfM' function to load the home interface for a wired-in thing,
120 -- so that we're sure that we see its instance declarations and rules
121 -- See Note [Loading instances]
122 loadWiredInHomeIface :: Name -> IfM lcl ()
123 loadWiredInHomeIface name
124 = ASSERT( isWiredInName name )
125 do loadSysInterface doc (nameModule name); return ()
127 doc = ptext SLIT("Need home interface for wired-in thing") <+> ppr name
129 -- | A wrapper for 'loadInterface' that throws an exception if it fails
130 loadSysInterface :: SDoc -> Module -> IfM lcl ModIface
131 loadSysInterface doc mod_name
132 = do { mb_iface <- loadInterface doc mod_name ImportBySystem
134 Failed err -> ghcError (ProgramError (showSDoc err))
135 Succeeded iface -> return iface }
138 Note [Loading instances]
139 ~~~~~~~~~~~~~~~~~~~~~~~~
140 We need to make sure that we have at least *read* the interface files
141 for any module with an instance decl or RULE that we might want.
143 * If the instance decl is an orphan, we have a whole separate mechanism
146 * If the instance decl not an orphan, then the act of looking at the
147 TyCon or Class will force in the defining module for the
148 TyCon/Class, and hence the instance decl
150 * BUT, if the TyCon is a wired-in TyCon, we don't really need its interface;
151 but we must make sure we read its interface in case it has instances or
152 rules. That is what LoadIface.loadWiredInHomeInterface does. It's called
153 from TcIface.{tcImportDecl, checkWiredInTyCon, ifCHeckWiredInThing}
155 All of this is done by the type checker. The renamer plays no role.
156 (It used to, but no longer.)
160 %*********************************************************
164 The main function to load an interface
165 for an imported module, and put it in
166 the External Package State
168 %*********************************************************
171 loadInterface :: SDoc -> Module -> WhereFrom
172 -> IfM lcl (MaybeErr Message ModIface)
174 -- loadInterface looks in both the HPT and PIT for the required interface
175 -- If not found, it loads it, and puts it in the PIT (always).
177 -- If it can't find a suitable interface file, we
178 -- a) modify the PackageIfaceTable to have an empty entry
179 -- (to avoid repeated complaints)
180 -- b) return (Left message)
182 -- It's not necessarily an error for there not to be an interface
183 -- file -- perhaps the module has changed, and that interface
186 loadInterface doc_str mod from
187 = do { -- Read the state
188 (eps,hpt) <- getEpsAndHpt
190 ; traceIf (text "Considering whether to load" <+> ppr mod <+> ppr from)
192 -- Check whether we have the interface already
194 ; case lookupIfaceByModule dflags hpt (eps_PIT eps) mod of {
196 -> returnM (Succeeded iface) ; -- Already loaded
197 -- The (src_imp == mi_boot iface) test checks that the already-loaded
198 -- interface isn't a boot iface. This can conceivably happen,
199 -- if an earlier import had a before we got to real imports. I think.
202 let { hi_boot_file = case from of
203 ImportByUser usr_boot -> usr_boot
204 ImportBySystem -> sys_boot
206 ; mb_dep = lookupUFM (eps_is_boot eps) (moduleName mod)
207 ; sys_boot = case mb_dep of
208 Just (_, is_boot) -> is_boot
210 -- The boot-ness of the requested interface,
211 } -- based on the dependencies in directly-imported modules
213 -- READ THE MODULE IN
214 ; read_result <- findAndReadIface doc_str mod hi_boot_file
215 ; case read_result of {
217 { let fake_iface = emptyModIface mod
219 ; updateEps_ $ \eps ->
220 eps { eps_PIT = extendModuleEnv (eps_PIT eps) (mi_module fake_iface) fake_iface }
221 -- Not found, so add an empty iface to
222 -- the EPS map so that we don't look again
224 ; returnM (Failed err) } ;
227 Succeeded (iface, file_path) -- Sanity check:
228 | ImportBySystem <- from, -- system-importing...
229 modulePackageId (mi_module iface) == thisPackage dflags,
230 -- a home-package module...
231 Nothing <- mb_dep -- that we know nothing about
232 -> returnM (Failed (badDepMsg mod))
237 loc_doc = text file_path
239 initIfaceLcl mod loc_doc $ do
241 -- Load the new ModIface into the External Package State
242 -- Even home-package interfaces loaded by loadInterface
243 -- (which only happens in OneShot mode; in Batch/Interactive
244 -- mode, home-package modules are loaded one by one into the HPT)
245 -- are put in the EPS.
247 -- The main thing is to add the ModIface to the PIT, but
249 -- IfaceDecls, IfaceInst, IfaceFamInst, IfaceRules, IfaceVectInfo
250 -- out of the ModIface and put them into the big EPS pools
252 -- NB: *first* we do loadDecl, so that the provenance of all the locally-defined
253 --- names is done correctly (notably, whether this is an .hi file or .hi-boot file).
254 -- If we do loadExport first the wrong info gets into the cache (unless we
255 -- explicitly tag each export which seems a bit of a bore)
257 ; ignore_prags <- doptM Opt_IgnoreInterfacePragmas
258 ; new_eps_decls <- loadDecls ignore_prags (mi_decls iface)
259 ; new_eps_insts <- mapM tcIfaceInst (mi_insts iface)
260 ; new_eps_fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface)
261 ; new_eps_rules <- tcIfaceRules ignore_prags (mi_rules iface)
262 ; new_eps_vect_info <- tcIfaceVectInfo mod (mkNameEnv new_eps_decls)
265 ; let { final_iface = iface {
266 mi_decls = panic "No mi_decls in PIT",
267 mi_insts = panic "No mi_insts in PIT",
268 mi_fam_insts = panic "No mi_fam_insts in PIT",
269 mi_rules = panic "No mi_rules in PIT"
273 ; updateEps_ $ \ eps ->
275 eps_PIT = extendModuleEnv (eps_PIT eps) mod final_iface,
276 eps_PTE = addDeclsToPTE (eps_PTE eps) new_eps_decls,
277 eps_rule_base = extendRuleBaseList (eps_rule_base eps)
279 eps_inst_env = extendInstEnvList (eps_inst_env eps)
281 eps_fam_inst_env = extendFamInstEnvList (eps_fam_inst_env eps)
283 eps_vect_info = plusVectInfo (eps_vect_info eps)
288 extendFamInstEnvList emptyFamInstEnv
291 extendModuleEnv (eps_mod_fam_inst_env eps)
294 eps_stats = addEpsInStats (eps_stats eps)
295 (length new_eps_decls)
296 (length new_eps_insts) (length new_eps_rules) }
298 ; return (Succeeded final_iface)
302 = hang (ptext SLIT("Interface file inconsistency:"))
303 2 (sep [ptext SLIT("home-package module") <+> quotes (ppr mod) <+> ptext SLIT("is mentioned is needed,"),
304 ptext SLIT("but is not among the dependencies of interfaces directly imported by the module being compiled")])
306 -----------------------------------------------------
307 -- Loading type/class/value decls
308 -- We pass the full Module name here, replete with
309 -- its package info, so that we can build a Name for
310 -- each binder with the right package info in it
311 -- All subsequent lookups, including crucially lookups during typechecking
312 -- the declaration itself, will find the fully-glorious Name
314 -- We handle ATs specially. They are not main declarations, but also not
315 -- implict things (in particular, adding them to `implicitTyThings' would mess
316 -- things up in the renaming/type checking of source programs).
317 -----------------------------------------------------
319 addDeclsToPTE :: PackageTypeEnv -> [(Name,TyThing)] -> PackageTypeEnv
320 addDeclsToPTE pte things = extendNameEnvList pte things
323 -> [(Version, IfaceDecl)]
324 -> IfL [(Name,TyThing)]
325 loadDecls ignore_prags ver_decls
326 = do { mod <- getIfModule
327 ; thingss <- mapM (loadDecl ignore_prags mod) ver_decls
328 ; return (concat thingss)
331 loadDecl :: Bool -- Don't load pragmas into the decl pool
333 -> (Version, IfaceDecl)
334 -> IfL [(Name,TyThing)] -- The list can be poked eagerly, but the
335 -- TyThings are forkM'd thunks
336 loadDecl ignore_prags mod (_version, decl)
337 = do { -- Populate the name cache with final versions of all
338 -- the names associated with the decl
339 main_name <- mk_new_bndr mod (ifName decl)
340 -- ; traceIf (text "Loading decl for " <> ppr main_name)
341 ; implicit_names <- mapM (mk_new_bndr mod) (ifaceDeclSubBndrs decl)
343 -- Typecheck the thing, lazily
344 -- NB. Firstly, the laziness is there in case we never need the
345 -- declaration (in one-shot mode), and secondly it is there so that
346 -- we don't look up the occurrence of a name before calling mk_new_bndr
347 -- on the binder. This is important because we must get the right name
348 -- which includes its nameParent.
350 ; thing <- forkM doc $ do { bumpDeclStats main_name
351 ; tcIfaceDecl ignore_prags decl }
353 -- Populate the type environment with the implicitTyThings too.
355 -- Note [Tricky iface loop]
356 -- ~~~~~~~~~~~~~~~~~~~~~~~~
357 -- The delicate point here is that 'mini-env' should be
358 -- buildable from 'thing' without demanding any of the things 'forkM'd
359 -- by tcIfaceDecl. For example
360 -- class C a where { data T a; op :: T a -> Int }
361 -- We return the bindings
362 -- [("C", <cls>), ("T", lookup env "T"), ("op", lookup env "op")]
363 -- The call (lookup env "T") must return the tycon T without first demanding
364 -- op; because getting the latter will look up T, hence loop.
366 -- Of course, there is no reason in principle why (lookup env "T") should demand
367 -- anything do to with op, but take care:
368 -- (a) implicitTyThings, and
369 -- (b) getOccName of all the things returned by implicitThings,
370 -- must not depend on any of the nested type-checks
372 -- All a bit too finely-balanced for my liking.
374 ; let mini_env = mkOccEnv [(getOccName t, t) | t <- implicitTyThings thing]
375 lookup n = case lookupOccEnv mini_env (getOccName n) of
378 pprPanic "loadDecl" (ppr main_name <+> ppr n $$ ppr (decl))
380 ; returnM $ (main_name, thing) : [(n, lookup n) | n <- implicit_names]
382 -- We build a list from the *known* names, with (lookup n) thunks
383 -- as the TyThings. That way we can extend the PTE without poking the
386 -- mk_new_bndr allocates in the name cache the final canonical
387 -- name for the thing, with the correct
390 -- imported name, to fix the module correctly in the cache
392 = newGlobalBinder mod occ (importedSrcSpan (moduleNameFS (moduleName mod)))
393 -- ToDo: qualify with the package name if necessary
395 doc = ptext SLIT("Declaration for") <+> ppr (ifName decl)
397 bumpDeclStats :: Name -> IfL () -- Record that one more declaration has actually been used
399 = do { traceIf (text "Loading decl for" <+> ppr name)
400 ; updateEps_ (\eps -> let stats = eps_stats eps
401 in eps { eps_stats = stats { n_decls_out = n_decls_out stats + 1 } })
406 %*********************************************************
408 \subsection{Reading an interface file}
410 %*********************************************************
413 findAndReadIface :: SDoc -> Module
414 -> IsBootInterface -- True <=> Look for a .hi-boot file
415 -- False <=> Look for .hi file
416 -> TcRnIf gbl lcl (MaybeErr Message (ModIface, FilePath))
417 -- Nothing <=> file not found, or unreadable, or illegible
418 -- Just x <=> successfully found and parsed
420 -- It *doesn't* add an error to the monad, because
421 -- sometimes it's ok to fail... see notes with loadInterface
423 findAndReadIface doc_str mod hi_boot_file
424 = do { traceIf (sep [hsep [ptext SLIT("Reading"),
426 then ptext SLIT("[boot]")
428 ptext SLIT("interface for"),
430 nest 4 (ptext SLIT("reason:") <+> doc_str)])
432 -- Check for GHC.Prim, and return its static interface
435 then returnM (Succeeded (ghcPrimIface,
436 "<built in interface for GHC.Prim>"))
440 ; hsc_env <- getTopEnv
441 ; mb_found <- ioToIOEnv (findExactModule hsc_env mod)
444 err | notFound err -> do
445 { traceIf (ptext SLIT("...not found"))
447 ; returnM (Failed (cannotFindInterface dflags
448 (moduleName mod) err)) } ;
451 -- Found file, so read it
452 { let { file_path = addBootSuffix_maybe hi_boot_file (ml_hi_file loc) }
454 ; if thisPackage dflags == modulePackageId mod
455 && not (isOneShot (ghcMode dflags))
456 then returnM (Failed (homeModError mod loc))
459 ; traceIf (ptext SLIT("readIFace") <+> text file_path)
460 ; read_result <- readIface mod file_path hi_boot_file
461 ; case read_result of
462 Failed err -> returnM (Failed (badIfaceFile file_path err))
464 | mi_module iface /= mod ->
465 return (Failed (wrongIfaceModErr iface mod file_path))
467 returnM (Succeeded (iface, file_path))
468 -- Don't forget to fill in the package name...
471 notFound (Found _ _) = False
475 @readIface@ tries just the one file.
478 readIface :: Module -> FilePath -> IsBootInterface
479 -> TcRnIf gbl lcl (MaybeErr Message ModIface)
480 -- Failed err <=> file not found, or unreadable, or illegible
481 -- Succeeded iface <=> successfully found and parsed
483 readIface wanted_mod file_path is_hi_boot_file
484 = do { dflags <- getDOpts
485 ; res <- tryMostM $ readBinIface file_path
488 | wanted_mod == actual_mod -> return (Succeeded iface)
489 | otherwise -> return (Failed err)
491 actual_mod = mi_module iface
492 err = hiModuleNameMismatchWarn wanted_mod actual_mod
494 Left exn -> return (Failed (text (showException exn)))
499 %*********************************************************
501 Wired-in interface for GHC.Prim
503 %*********************************************************
506 initExternalPackageState :: ExternalPackageState
507 initExternalPackageState
509 eps_is_boot = emptyUFM,
510 eps_PIT = emptyPackageIfaceTable,
511 eps_PTE = emptyTypeEnv,
512 eps_inst_env = emptyInstEnv,
513 eps_fam_inst_env = emptyFamInstEnv,
514 eps_rule_base = mkRuleBase builtinRules,
515 -- Initialise the EPS rule pool with the built-in rules
518 eps_vect_info = noVectInfo,
519 eps_stats = EpsStats { n_ifaces_in = 0, n_decls_in = 0, n_decls_out = 0
520 , n_insts_in = 0, n_insts_out = 0
521 , n_rules_in = length builtinRules, n_rules_out = 0 }
526 %*********************************************************
528 Wired-in interface for GHC.Prim
530 %*********************************************************
533 ghcPrimIface :: ModIface
535 = (emptyModIface gHC_PRIM) {
536 mi_exports = [(gHC_PRIM, ghcPrimExports)],
538 mi_fixities = fixities,
539 mi_fix_fn = mkIfaceFixCache fixities
542 fixities = [(getOccName seqId, Fixity 0 InfixR)]
546 %*********************************************************
548 \subsection{Statistics}
550 %*********************************************************
553 ifaceStats :: ExternalPackageState -> SDoc
555 = hcat [text "Renamer stats: ", msg]
557 stats = eps_stats eps
559 [int (n_ifaces_in stats) <+> text "interfaces read",
560 hsep [ int (n_decls_out stats), text "type/class/variable imported, out of",
561 int (n_decls_in stats), text "read"],
562 hsep [ int (n_insts_out stats), text "instance decls imported, out of",
563 int (n_insts_in stats), text "read"],
564 hsep [ int (n_rules_out stats), text "rule decls imported, out of",
565 int (n_rules_in stats), text "read"]
570 %************************************************************************
574 %************************************************************************
577 -- | Read binary interface, and print it out
578 showIface :: HscEnv -> FilePath -> IO ()
579 showIface hsc_env filename = do
580 -- skip the version check; we don't want to worry about profiled vs.
581 -- non-profiled interfaces, for example.
582 writeIORef v_IgnoreHiWay True
583 iface <- initTcRnIf 's' hsc_env () () $ readBinIface filename
584 printDump (pprModIface iface)
588 pprModIface :: ModIface -> SDoc
591 = vcat [ ptext SLIT("interface")
592 <+> ppr (mi_module iface) <+> pp_boot
593 <+> ppr (mi_mod_vers iface) <+> pp_sub_vers
594 <+> (if mi_orphan iface then ptext SLIT("[orphan module]") else empty)
595 <+> (if mi_finsts iface then ptext SLIT("[family instance module]") else empty)
596 <+> (if mi_hpc iface then ptext SLIT("[hpc]") else empty)
597 <+> integer opt_HiVersion
598 <+> ptext SLIT("where")
599 , vcat (map pprExport (mi_exports iface))
600 , pprDeps (mi_deps iface)
601 , vcat (map pprUsage (mi_usages iface))
602 , pprFixities (mi_fixities iface)
603 , vcat (map pprIfaceDecl (mi_decls iface))
604 , vcat (map ppr (mi_insts iface))
605 , vcat (map ppr (mi_fam_insts iface))
606 , vcat (map ppr (mi_rules iface))
607 , pprVectInfo (mi_vect_info iface)
608 , pprDeprecs (mi_deprecs iface)
611 pp_boot | mi_boot iface = ptext SLIT("[boot]")
614 exp_vers = mi_exp_vers iface
615 rule_vers = mi_rule_vers iface
617 pp_sub_vers | exp_vers == initialVersion && rule_vers == initialVersion = empty
618 | otherwise = brackets (ppr exp_vers <+> ppr rule_vers)
621 When printing export lists, we print like this:
623 AvailTC C [C, x, y] C(x,y)
624 AvailTC C [x, y] C!(x,y) -- Exporting x, y but not C
627 pprExport :: IfaceExport -> SDoc
628 pprExport (mod, items)
629 = hsep [ ptext SLIT("export"), ppr mod, hsep (map pp_avail items) ]
631 pp_avail :: GenAvailInfo OccName -> SDoc
632 pp_avail (Avail occ) = ppr occ
633 pp_avail (AvailTC _ []) = empty
634 pp_avail (AvailTC n (n':ns))
635 | n==n' = ppr n <> pp_export ns
636 | otherwise = ppr n <> char '|' <> pp_export (n':ns)
639 pp_export names = braces (hsep (map ppr names))
641 pprUsage :: Usage -> SDoc
643 = hsep [ptext SLIT("import"), ppr (usg_name usage),
645 pp_export_version (usg_exports usage),
646 int (usg_rules usage),
647 pp_versions (usg_entities usage) ]
649 pp_versions nvs = hsep [ ppr n <+> int v | (n,v) <- nvs ]
650 pp_export_version Nothing = empty
651 pp_export_version (Just v) = int v
653 pprDeps :: Dependencies -> SDoc
654 pprDeps (Deps { dep_mods = mods, dep_pkgs = pkgs, dep_orphs = orphs,
655 dep_finsts = finsts })
656 = vcat [ptext SLIT("module dependencies:") <+> fsep (map ppr_mod mods),
657 ptext SLIT("package dependencies:") <+> fsep (map ppr pkgs),
658 ptext SLIT("orphans:") <+> fsep (map ppr orphs),
659 ptext SLIT("family instance modules:") <+> fsep (map ppr finsts)
662 ppr_mod (mod_name, boot) = ppr mod_name <+> ppr_boot boot
663 ppr_boot True = text "[boot]"
664 ppr_boot False = empty
666 pprIfaceDecl :: (Version, IfaceDecl) -> SDoc
667 pprIfaceDecl (ver, decl)
668 = ppr_vers ver <+> ppr decl
670 -- Print the version for the decl
671 ppr_vers v | v == initialVersion = empty
674 pprFixities :: [(OccName, Fixity)] -> SDoc
675 pprFixities [] = empty
676 pprFixities fixes = ptext SLIT("fixities") <+> pprWithCommas pprFix fixes
678 pprFix (occ,fix) = ppr fix <+> ppr occ
680 pprVectInfo :: IfaceVectInfo -> SDoc
681 pprVectInfo (IfaceVectInfo { ifaceVectInfoVar = vars
682 , ifaceVectInfoTyCon = tycons
683 , ifaceVectInfoTyConReuse = tyconsReuse
686 [ ptext SLIT("vectorised variables:") <+> hsep (map ppr vars)
687 , ptext SLIT("vectorised tycons:") <+> hsep (map ppr tycons)
688 , ptext SLIT("vectorised reused tycons:") <+> hsep (map ppr tyconsReuse)
691 pprDeprecs NoDeprecs = empty
692 pprDeprecs (DeprecAll txt) = ptext SLIT("Deprecate all") <+> doubleQuotes (ftext txt)
693 pprDeprecs (DeprecSome prs) = ptext SLIT("Deprecate") <+> vcat (map pprDeprec prs)
695 pprDeprec (name, txt) = ppr name <+> doubleQuotes (ftext txt)
699 %*********************************************************
703 %*********************************************************
706 badIfaceFile file err
707 = vcat [ptext SLIT("Bad interface file:") <+> text file,
710 hiModuleNameMismatchWarn :: Module -> Module -> Message
711 hiModuleNameMismatchWarn requested_mod read_mod =
712 withPprStyle defaultUserStyle $
713 -- we want the Modules below to be qualified with package names,
714 -- so reset the PrintUnqualified setting.
715 hsep [ ptext SLIT("Something is amiss; requested module ")
717 , ptext SLIT("differs from name found in the interface file")
721 wrongIfaceModErr iface mod_name file_path
722 = sep [ptext SLIT("Interface file") <+> iface_file,
723 ptext SLIT("contains module") <+> quotes (ppr (mi_module iface)) <> comma,
724 ptext SLIT("but we were expecting module") <+> quotes (ppr mod_name),
725 sep [ptext SLIT("Probable cause: the source code which generated"),
727 ptext SLIT("has an incompatible module name")
730 where iface_file = doubleQuotes (text file_path)
732 homeModError mod location
733 = ptext SLIT("attempting to use module ") <> quotes (ppr mod)
734 <> (case ml_hs_file location of
735 Just file -> space <> parens (text file)
737 <+> ptext SLIT("which is not loaded")