import TcRnMonad
import FiniteMap
-import PrelNames ( pRELUDE_Name, isBuiltInSyntaxName, isUnboundName,
+import PrelNames ( pRELUDE_Name, isUnboundName,
main_RDR_Unqual )
import Module ( Module, ModuleName, moduleName, mkPackageModule,
moduleNameUserString, isHomeModule,
unitModuleEnvByName, unitModuleEnv,
lookupModuleEnvByName, moduleEnvElts )
import Name ( Name, nameSrcLoc, nameOccName, nameModuleName, isWiredInName,
- nameParent, nameParent_maybe, isExternalName, nameModule )
+ nameParent, nameParent_maybe, isExternalName, nameModule,
+ isBuiltInSyntax )
import NameSet
import NameEnv
import OccName ( srcDataName, isTcOcc, occNameFlavour, OccEnv,
unLoc, noLoc, srcLocSpan, SrcSpan )
import BasicTypes ( DeprecTxt )
import ListSetOps ( removeDups )
-import Util ( sortLt, notNull, isSingleton )
+import Util ( sortLe, notNull, isSingleton )
import List ( partition )
import IO ( openFile, IOMode(..) )
\end{code}
avails' | implicit_prelude = filter not_built_in_syntax avails
| otherwise = avails
- not_built_in_syntax a = not (all isBuiltInSyntaxName (availNames a))
+ not_built_in_syntax a = not (all isBuiltInSyntax (availNames a))
-- Only filter it if all the names of the avail are built-in
-- In particular, lists have (:) which is not built in syntax
- -- so we don't filter it out. [Sept 03: wrong: see isBuiltInSyntaxName]
+ -- so we don't filter it out. [Sept 03: wrong: see isBuiltInSyntax]
avail_env = mkAvailEnv avails'
imports = emptyImportAvails {
nest 2 (ptext SLIT("other declarations at:")),
nest 4 (vcat (map ppr sorted_locs))]
where
- sorted_locs = sortLt occ'ed_before (map nameSrcLoc ns)
- occ'ed_before a b = LT == compare a b
+ sorted_locs = sortLe occ'ed_before (map nameSrcLoc ns)
+ occ'ed_before a b = case compare a b of
+ LT -> True
+ EQ -> True
+ GT -> False
dupExportWarn occ_name ie1 ie2
= hsep [quotes (ppr occ_name),