diff --git a/liquidhaskell-boot/src-ghc/Liquid/GHC/API.hs b/liquidhaskell-boot/src-ghc/Liquid/GHC/API.hs index f42f39d19d..b6735063bf 100644 --- a/liquidhaskell-boot/src-ghc/Liquid/GHC/API.hs +++ b/liquidhaskell-boot/src-ghc/Liquid/GHC/API.hs @@ -168,14 +168,12 @@ import GHC.Builtin.Names as Ghc , Unique , and_RDR , bindMName - , gHC_INTERNAL_DATA_FOLDABLE , eqClassKey , eqClassName , ge_RDR , gt_RDR , fractionalClassKey , fractionalClassKeys - , gHC_INTERNAL_REAL , getUnique , hasKey , isStringClassName diff --git a/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs b/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs index cf20c34fad..cd2d764f53 100644 --- a/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs +++ b/liquidhaskell-boot/src-ghc/Liquid/GHC/API/Compat.hs @@ -1,9 +1,14 @@ module Liquid.GHC.API.Compat ( UniqueId , toUniqueId + + , foldableModule + , realModule ) where import Data.Word (Word64) +import qualified GHC.Builtin.Names as Ghc +import GHC (Module) ---------------------- -- Uniques @@ -13,3 +18,12 @@ type UniqueId = Word64 toUniqueId :: Word64 -> UniqueId toUniqueId = id + +---------------------- +-- Built-in modules +---------------------- + +foldableModule, realModule :: Module + +foldableModule = Ghc.gHC_INTERNAL_DATA_FOLDABLE +realModule = Ghc.gHC_INTERNAL_REAL diff --git a/liquidhaskell-boot/src/Language/Haskell/Liquid/Bare/Elaborate.hs b/liquidhaskell-boot/src/Language/Haskell/Liquid/Bare/Elaborate.hs index 19259f9fa8..45189a062e 100644 --- a/liquidhaskell-boot/src/Language/Haskell/Liquid/Bare/Elaborate.hs +++ b/liquidhaskell-boot/src/Language/Haskell/Liquid/Bare/Elaborate.hs @@ -604,7 +604,7 @@ fixExprToHsExpr env (F.PAnd (e : es)) = L.foldr f (fixExprToHsExpr env e) es -- (nlHsVar (varQual_RDR dATA_FOLDABLE (fsLit "and"))) -- (nlList $ fixExprToHsExpr env <$> es) fixExprToHsExpr env (F.POr es) = mkHsApp - (nlHsVar (varQual_RDR gHC_INTERNAL_DATA_FOLDABLE (fsLit "or"))) + (nlHsVar (varQual_RDR foldableModule (fsLit "or"))) (nlList $ fixExprToHsExpr env <$> es) fixExprToHsExpr env (F.PIff e0 e1) = mkHsApp (mkHsApp (nlHsVar (mkVarUnqual (mkFastString "<=>"))) (fixExprToHsExpr env e0) diff --git a/liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Misc.hs b/liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Misc.hs index 113bdcbcf8..98327d0403 100644 --- a/liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Misc.hs +++ b/liquidhaskell-boot/src/Language/Haskell/Liquid/GHC/Misc.hs @@ -993,7 +993,7 @@ withWiredIn m = discardConstraints $ do return $ TcWiredIn n Nothing ty prependGHCRealQual :: FastString -> RdrName -prependGHCRealQual = varQual_RDR gHC_INTERNAL_REAL +prependGHCRealQual = varQual_RDR realModule isFromGHCReal :: NamedThing a => a -> Bool -isFromGHCReal x = Ghc.nameModule (Ghc.getName x) == gHC_INTERNAL_REAL +isFromGHCReal x = Ghc.nameModule (Ghc.getName x) == realModule