summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorWander Hillen <wjw.hillen@gmail.com>2020-09-12 16:06:04 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-19 15:48:41 -0400
commite195dae6d959e2a9b1a22a2ca78db5955e1d7dea (patch)
tree9ea82263c4a60c915ff93b9a3643245fbb8f2a46 /compiler/GHC/Rename
parentac213d267140e747a391f68bc9f060e117395547 (diff)
downloadhaskell-e195dae6d959e2a9b1a22a2ca78db5955e1d7dea.tar.gz
Export singleton function from Data.List
Data.OldList exports a monomorphized singleton function but it is not re-exported by Data.List. Adding the export to Data.List causes a conflict with a 14-year old function of the same name and type by SPJ in GHC.Utils.Misc. We can't just remove this function because that leads to a problems when building GHC with a stage0 compiler that does not have singleton in Data.List yet. We also can't hide the function in GHC.Utils.Misc since it is not possible to hide a function from a module if the module does not export the function. To work around this, all places where the Utils.Misc singleton was used now use a qualified version like Utils.singleton and in GHC.Utils.Misc we are very specific about which version we export.
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/Names.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs
index 13a592423a..e587720a3e 100644
--- a/compiler/GHC/Rename/Names.hs
+++ b/compiler/GHC/Rename/Names.hs
@@ -58,7 +58,7 @@ import GHC.Utils.Outputable as Outputable
import GHC.Data.Maybe
import GHC.Types.SrcLoc as SrcLoc
import GHC.Types.Basic ( TopLevelFlag(..), StringLiteral(..) )
-import GHC.Utils.Misc
+import GHC.Utils.Misc as Utils
import GHC.Utils.Panic
import GHC.Data.FastString
import GHC.Data.FastString.Env
@@ -1186,8 +1186,8 @@ mkChildEnv :: [GlobalRdrElt] -> NameEnv [GlobalRdrElt]
mkChildEnv gres = foldr add emptyNameEnv gres
where
add gre env = case gre_par gre of
- FldParent p _ -> extendNameEnv_Acc (:) singleton env p gre
- ParentIs p -> extendNameEnv_Acc (:) singleton env p gre
+ FldParent p _ -> extendNameEnv_Acc (:) Utils.singleton env p gre
+ ParentIs p -> extendNameEnv_Acc (:) Utils.singleton env p gre
NoParent -> env
findChildren :: NameEnv [a] -> Name -> [a]