summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-01-26 03:15:37 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-14 05:32:37 -0500
commitcf739945b8b28ff463dc44925348f20b3c1f22cb (patch)
tree855da097719d6b62a15fa12034c60379c49dc4a5
parentaf6a0c36431639655762440ec8d652796b86fe58 (diff)
downloadhaskell-cf739945b8b28ff463dc44925348f20b3c1f22cb.tar.gz
Module hierarchy: HsToCore (cf #13009)
-rw-r--r--compiler/GHC/Hs/Binds.hs2
-rw-r--r--compiler/GHC/Hs/Decls.hs8
-rw-r--r--compiler/GHC/Hs/Expr.hs6
-rw-r--r--compiler/GHC/Hs/Lit.hs2
-rw-r--r--compiler/GHC/Hs/Pat.hs2
-rw-r--r--compiler/GHC/Hs/Utils.hs12
-rw-r--r--compiler/GHC/HsToCore.hs (renamed from compiler/deSugar/Desugar.hs)18
-rw-r--r--compiler/GHC/HsToCore/Arrows.hs (renamed from compiler/deSugar/DsArrows.hs)14
-rw-r--r--compiler/GHC/HsToCore/Binds.hs (renamed from compiler/deSugar/DsBinds.hs)24
-rw-r--r--compiler/GHC/HsToCore/Binds.hs-boot6
-rw-r--r--compiler/GHC/HsToCore/Coverage.hs (renamed from compiler/deSugar/Coverage.hs)2
-rw-r--r--compiler/GHC/HsToCore/Docs.hs (renamed from compiler/deSugar/ExtractDocs.hs)2
-rw-r--r--compiler/GHC/HsToCore/Expr.hs (renamed from compiler/deSugar/DsExpr.hs)39
-rw-r--r--compiler/GHC/HsToCore/Expr.hs-boot (renamed from compiler/deSugar/DsExpr.hs-boot)10
-rw-r--r--compiler/GHC/HsToCore/Foreign/Call.hs (renamed from compiler/deSugar/DsCCall.hs)20
-rw-r--r--compiler/GHC/HsToCore/Foreign/Decl.hs (renamed from compiler/deSugar/DsForeign.hs)14
-rw-r--r--compiler/GHC/HsToCore/GuardedRHSs.hs (renamed from compiler/deSugar/DsGRHSs.hs)10
-rw-r--r--compiler/GHC/HsToCore/ListComp.hs (renamed from compiler/deSugar/DsListComp.hs)14
-rw-r--r--compiler/GHC/HsToCore/Match.hs (renamed from compiler/deSugar/Match.hs)27
-rw-r--r--compiler/GHC/HsToCore/Match.hs-boot (renamed from compiler/deSugar/Match.hs-boot)4
-rw-r--r--compiler/GHC/HsToCore/Match/Constructor.hs (renamed from compiler/deSugar/MatchCon.hs)10
-rw-r--r--compiler/GHC/HsToCore/Match/Literal.hs (renamed from compiler/deSugar/MatchLit.hs)28
-rw-r--r--compiler/GHC/HsToCore/Monad.hs (renamed from compiler/deSugar/DsMonad.hs)12
-rw-r--r--compiler/GHC/HsToCore/PmCheck.hs18
-rw-r--r--compiler/GHC/HsToCore/PmCheck/Oracle.hs2
-rw-r--r--compiler/GHC/HsToCore/Quote.hs (renamed from compiler/deSugar/DsMeta.hs)20
-rw-r--r--compiler/GHC/HsToCore/Usage.hs (renamed from compiler/deSugar/DsUsage.hs)2
-rw-r--r--compiler/GHC/HsToCore/Utils.hs (renamed from compiler/deSugar/DsUtils.hs)16
-rw-r--r--compiler/GHC/Iface/Ext/Ast.hs2
-rw-r--r--compiler/GHC/Iface/Utils.hs4
-rw-r--r--compiler/GHC/Rename/Expr.hs6
-rw-r--r--compiler/GHC/ThToHs.hs9
-rw-r--r--compiler/basicTypes/BasicTypes.hs6
-rw-r--r--compiler/basicTypes/DataCon.hs3
-rw-r--r--compiler/basicTypes/Id.hs2
-rw-r--r--compiler/basicTypes/MkId.hs4
-rw-r--r--compiler/basicTypes/NameCache.hs4
-rw-r--r--compiler/coreSyn/CoreOpt.hs2
-rw-r--r--compiler/coreSyn/CoreSubst.hs2
-rw-r--r--compiler/coreSyn/CoreSyn.hs2
-rw-r--r--compiler/deSugar/DsBinds.hs-boot6
-rw-r--r--compiler/ghc.cabal.in35
-rw-r--r--compiler/main/DriverPipeline.hs4
-rw-r--r--compiler/main/HscMain.hs2
-rw-r--r--compiler/main/HscTypes.hs4
-rw-r--r--compiler/prelude/THNames.hs4
-rw-r--r--compiler/prelude/TysWiredIn.hs2
-rw-r--r--compiler/specialise/Rules.hs2
-rw-r--r--compiler/typecheck/TcEvidence.hs4
-rw-r--r--compiler/typecheck/TcHoleErrors.hs2
-rw-r--r--compiler/typecheck/TcHsSyn.hs4
-rw-r--r--compiler/typecheck/TcInstDcls.hs2
-rw-r--r--compiler/typecheck/TcMType.hs4
-rw-r--r--compiler/typecheck/TcPatSyn.hs2
-rw-r--r--compiler/typecheck/TcRnMonad.hs2
-rw-r--r--compiler/typecheck/TcSigs.hs2
-rw-r--r--compiler/typecheck/TcSplice.hs14
-rw-r--r--compiler/typecheck/TcTyClsDecls.hs2
-rw-r--r--ghc/GHCi/UI/Info.hs2
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Syntax.hs5
60 files changed, 254 insertions, 240 deletions
diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs
index 1c393bbe99..2014d92c25 100644
--- a/compiler/GHC/Hs/Binds.hs
+++ b/compiler/GHC/Hs/Binds.hs
@@ -574,7 +574,7 @@ let-binding. When abs_sig = True
and hence the abs_binds is non-recursive
(it binds the mono_id but refers to the poly_id
-These properties are exploited in DsBinds.dsAbsBinds to
+These properties are exploited in GHC.HsToCore.Binds.dsAbsBinds to
generate code without a let-binding.
Note [ABExport wrapper]
diff --git a/compiler/GHC/Hs/Decls.hs b/compiler/GHC/Hs/Decls.hs
index abfd0ec476..490113f2eb 100644
--- a/compiler/GHC/Hs/Decls.hs
+++ b/compiler/GHC/Hs/Decls.hs
@@ -210,10 +210,10 @@ information from an `HsGroup`.
One might wonder why we even bother separating top-level fixity signatures
into two places at all. That is, why not just take the fixity signatures
from `hs_tyclds` and put them into `hs_fixds` so that they are all in one
-location? This ends up causing problems for `DsMeta.repTopDs`, which translates
-each fixity signature in `hs_fixds` and `hs_tyclds` into a Template Haskell
-`Dec`. If there are any duplicate signatures between the two fields, this will
-result in an error (#17608).
+location? This ends up causing problems for `GHC.HsToCore.Quote.repTopDs`,
+which translates each fixity signature in `hs_fixds` and `hs_tyclds` into a
+Template Haskell `Dec`. If there are any duplicate signatures between the two
+fields, this will result in an error (#17608).
-}
-- | Haskell Group
diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs
index f70d5c0382..6890484472 100644
--- a/compiler/GHC/Hs/Expr.hs
+++ b/compiler/GHC/Hs/Expr.hs
@@ -577,8 +577,8 @@ data RecordUpdTc = RecordUpdTc
-- | HsWrap appears only in typechecker output
-- Invariant: The contained Expr is *NOT* itself an HsWrap.
--- See Note [Detecting forced eta expansion] in DsExpr. This invariant
--- is maintained by GHC.Hs.Utils.mkHsWrap.
+-- See Note [Detecting forced eta expansion] in GHC.HsToCore.Expr.
+-- This invariant is maintained by GHC.Hs.Utils.mkHsWrap.
-- hs_syn is something like HsExpr or HsCmd
data HsWrap hs_syn = HsWrap HsWrapper -- the wrapper
(hs_syn GhcTc) -- the thing that is wrapped
@@ -2693,7 +2693,7 @@ data HsMatchContext p
-- (Just b) | Just _ <- x = e
-- | otherwise = e'
- | RecUpd -- ^Record update [used only in DsExpr to
+ | RecUpd -- ^Record update [used only in GHC.HsToCore.Expr to
-- tell matchWrapper what sort of
-- runtime error message to generate]
diff --git a/compiler/GHC/Hs/Lit.hs b/compiler/GHC/Hs/Lit.hs
index a023755ffc..dac9f4de93 100644
--- a/compiler/GHC/Hs/Lit.hs
+++ b/compiler/GHC/Hs/Lit.hs
@@ -199,7 +199,7 @@ found to have.
-}
-- Comparison operations are needed when grouping literals
--- for compiling pattern-matching (module MatchLit)
+-- for compiling pattern-matching (module GHC.HsToCore.Match.Literal)
instance (Eq (XXOverLit p)) => Eq (HsOverLit p) where
(OverLit _ val1 _) == (OverLit _ val2 _) = val1 == val2
(XOverLit val1) == (XOverLit val2) = val1 == val2
diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs
index 0a5bcb81d5..50db04e92e 100644
--- a/compiler/GHC/Hs/Pat.hs
+++ b/compiler/GHC/Hs/Pat.hs
@@ -425,7 +425,7 @@ data HsRecField' id arg = HsRecField {
--
-- The renamer produces an Unambiguous result if it can, rather than
-- just doing the lookup in the typechecker, so that completely
--- unambiguous updates can be represented by 'DsMeta.repUpdFields'.
+-- unambiguous updates can be represented by 'GHC.HsToCore.Quote.repUpdFields'.
--
-- For example, suppose we have:
--
diff --git a/compiler/GHC/Hs/Utils.hs b/compiler/GHC/Hs/Utils.hs
index 6cb8a7bda2..3864164263 100644
--- a/compiler/GHC/Hs/Utils.hs
+++ b/compiler/GHC/Hs/Utils.hs
@@ -759,7 +759,7 @@ mkLHsWrap :: HsWrapper -> LHsExpr GhcTc -> LHsExpr GhcTc
mkLHsWrap co_fn (L loc e) = L loc (mkHsWrap co_fn e)
-- | Avoid @'HsWrap' co1 ('HsWrap' co2 _)@ and @'HsWrap' co1 ('HsPar' _ _)@
--- See Note [Detecting forced eta expansion] in "DsExpr"
+-- See Note [Detecting forced eta expansion] in "GHC.HsToCore.Expr"
mkHsWrap :: HsWrapper -> HsExpr GhcTc -> HsExpr GhcTc
mkHsWrap co_fn e | isIdHsWrapper co_fn = e
mkHsWrap co_fn (XExpr (HsWrap co_fn' e)) = mkHsWrap (co_fn <.> co_fn') e
@@ -935,7 +935,7 @@ BUT we have a special case when abs_sig is true;
-- | Should we treat this as an unlifted bind? This will be true for any
-- bind that binds an unlifted variable, but we must be careful around
-- AbsBinds. See Note [Unlifted id check in isUnliftedHsBind]. For usage
--- information, see Note [Strict binds check] is DsBinds.
+-- information, see Note [Strict binds check] is GHC.HsToCore.Binds.
isUnliftedHsBind :: HsBind GhcTc -> Bool -- works only over typechecked binds
isUnliftedHsBind bind
| AbsBinds { abs_exports = exports, abs_sig = has_sig } <- bind
@@ -1103,17 +1103,17 @@ collect_lpat p bndrs
go (XPat {}) = bndrs
{-
-Note [Dictionary binders in ConPatOut] See also same Note in DsArrows
+Note [Dictionary binders in ConPatOut] See also same Note in GHC.HsToCore.Arrows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do *not* gather (a) dictionary and (b) dictionary bindings as binders
of a ConPatOut pattern. For most calls it doesn't matter, because
it's pre-typechecker and there are no ConPatOuts. But it does matter
-more in the desugarer; for example, DsUtils.mkSelectorBinds uses
+more in the desugarer; for example, GHC.HsToCore.Utils.mkSelectorBinds uses
collectPatBinders. In a lazy pattern, for example f ~(C x y) = ...,
we want to generate bindings for x,y but not for dictionaries bound by
C. (The type checker ensures they would not be used.)
-Desugaring of arrow case expressions needs these bindings (see DsArrows
+Desugaring of arrow case expressions needs these bindings (see GHC.HsToCore.Arrows
and arrowcase1), but SPJ (Jan 2007) says it's safer for it to use its
own pat-binder-collector:
@@ -1127,7 +1127,7 @@ f ~(C (n+1) m) = (n,m)
Here, the pattern (C (n+1)) binds a hidden dictionary (d::Num a),
and *also* uses that dictionary to match the (n+1) pattern. Yet, the
variables bound by the lazy pattern are n,m, *not* the dictionary d.
-So in mkSelectorBinds in DsUtils, we want just m,n as the variables bound.
+So in mkSelectorBinds in GHC.HsToCore.Utils, we want just m,n as the variables bound.
-}
hsGroupBinders :: HsGroup GhcRn -> [Name]
diff --git a/compiler/deSugar/Desugar.hs b/compiler/GHC/HsToCore.hs
index bbf67cfc48..6802319be2 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/GHC/HsToCore.hs
@@ -10,7 +10,7 @@ The Desugarer: turning HsSyn into Core.
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
-module Desugar (
+module GHC.HsToCore (
-- * Desugaring operations
deSugar, deSugarExpr
) where
@@ -19,7 +19,7 @@ module Desugar (
import GhcPrelude
-import DsUsage
+import GHC.HsToCore.Usage
import DynFlags
import HscTypes
import GHC.Hs
@@ -34,10 +34,10 @@ import CoreSyn
import CoreFVs ( exprsSomeFreeVarsList )
import CoreOpt ( simpleOptPgm, simpleOptExpr )
import PprCore
-import DsMonad
-import DsExpr
-import DsBinds
-import DsForeign
+import GHC.HsToCore.Monad
+import GHC.HsToCore.Expr
+import GHC.HsToCore.Binds
+import GHC.HsToCore.Foreign.Decl
import PrelNames ( coercibleTyConKey )
import TysPrim ( eqReprPrimTyCon )
import Unique ( hasKey )
@@ -57,11 +57,11 @@ import FastString
import ErrUtils
import Outputable
import SrcLoc
-import Coverage
+import GHC.HsToCore.Coverage
import Util
import MonadUtils
import OrdList
-import ExtractDocs
+import GHC.HsToCore.Docs
import Data.List
import Data.IORef
@@ -485,7 +485,7 @@ For the LHS of a RULE we do *not* want to desugar
[x] to build (\cn. x `c` n)
We want to leave explicit lists simply as chains
of cons's. We can achieve that slightly indirectly by
-switching off EnableRewriteRules. See DsExpr.dsExplicitList.
+switching off EnableRewriteRules. See GHC.HsToCore.Expr.dsExplicitList.
That keeps the desugaring of list comprehensions simple too.
diff --git a/compiler/deSugar/DsArrows.hs b/compiler/GHC/HsToCore/Arrows.hs
index 8c1e161dc9..450c879b90 100644
--- a/compiler/deSugar/DsArrows.hs
+++ b/compiler/GHC/HsToCore/Arrows.hs
@@ -12,15 +12,15 @@ Desugaring arrow commands
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
-module DsArrows ( dsProcExpr ) where
+module GHC.HsToCore.Arrows ( dsProcExpr ) where
#include "HsVersions.h"
import GhcPrelude
-import Match
-import DsUtils
-import DsMonad
+import GHC.HsToCore.Match
+import GHC.HsToCore.Utils
+import GHC.HsToCore.Monad
import GHC.Hs hiding (collectPatBinders, collectPatsBinders,
collectLStmtsBinders, collectLStmtBinders,
@@ -33,8 +33,8 @@ import qualified GHC.Hs.Utils as HsUtils
-- So WATCH OUT; check each use of split*Ty functions.
-- Sigh. This is a pain.
-import {-# SOURCE #-} DsExpr ( dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds,
- dsSyntaxExpr )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds,
+ dsSyntaxExpr )
import TcType
import Type ( splitPiTy )
@@ -43,7 +43,7 @@ import CoreSyn
import CoreFVs
import CoreUtils
import MkCore
-import DsBinds (dsHsWrapper)
+import GHC.HsToCore.Binds (dsHsWrapper)
import Id
import ConLike
diff --git a/compiler/deSugar/DsBinds.hs b/compiler/GHC/HsToCore/Binds.hs
index d573efc0c3..a6bbe4ca54 100644
--- a/compiler/deSugar/DsBinds.hs
+++ b/compiler/GHC/HsToCore/Binds.hs
@@ -17,20 +17,22 @@ lower levels it is preserved with @let@/@letrec@s).
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module DsBinds ( dsTopLHsBinds, dsLHsBinds, decomposeRuleLhs, dsSpec,
- dsHsWrapper, dsTcEvBinds, dsTcEvBinds_s, dsEvBinds, dsMkUserRule
- ) where
+module GHC.HsToCore.Binds
+ ( dsTopLHsBinds, dsLHsBinds, decomposeRuleLhs, dsSpec
+ , dsHsWrapper, dsTcEvBinds, dsTcEvBinds_s, dsEvBinds, dsMkUserRule
+ )
+where
#include "HsVersions.h"
import GhcPrelude
-import {-# SOURCE #-} DsExpr( dsLExpr )
-import {-# SOURCE #-} Match( matchWrapper )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsLExpr )
+import {-# SOURCE #-} GHC.HsToCore.Match ( matchWrapper )
-import DsMonad
-import DsGRHSs
-import DsUtils
+import GHC.HsToCore.Monad
+import GHC.HsToCore.GuardedRHSs
+import GHC.HsToCore.Utils
import GHC.HsToCore.PmCheck ( needToRunPmCheck, addTyCsDs, checkGuardMatches )
import GHC.Hs -- lots of things
@@ -565,7 +567,7 @@ if there is no variable in the pattern desugaring looks like
in x `seq` body
In order to force the Ids in the binding group they are passed around
-in the dsHsBind family of functions, and later seq'ed in DsExpr.ds_val_bind.
+in the dsHsBind family of functions, and later seq'ed in GHC.HsToCore.Expr.ds_val_bind.
Consider a recursive group like this
@@ -632,11 +634,11 @@ The restrictions are:
2. Unlifted binds must also be banged. (There is no trouble to compile an unbanged
unlifted bind, but an unbanged bind looks lazy, and we don't want users to be
surprised by the strictness of an unlifted bind.) Checked in first clause
- of DsExpr.ds_val_bind.
+ of GHC.HsToCore.Expr.ds_val_bind.
3. Unlifted binds may not have polymorphism (#6078). (That is, no quantified type
variables or constraints.) Checked in first clause
- of DsExpr.ds_val_bind.
+ of GHC.HsToCore.Expr.ds_val_bind.
4. Unlifted binds may not be recursive. Checked in second clause of ds_val_bind.
diff --git a/compiler/GHC/HsToCore/Binds.hs-boot b/compiler/GHC/HsToCore/Binds.hs-boot
new file mode 100644
index 0000000000..36e158b279
--- /dev/null
+++ b/compiler/GHC/HsToCore/Binds.hs-boot
@@ -0,0 +1,6 @@
+module GHC.HsToCore.Binds where
+import GHC.HsToCore.Monad ( DsM )
+import CoreSyn ( CoreExpr )
+import TcEvidence (HsWrapper)
+
+dsHsWrapper :: HsWrapper -> DsM (CoreExpr -> CoreExpr)
diff --git a/compiler/deSugar/Coverage.hs b/compiler/GHC/HsToCore/Coverage.hs
index 3e124b5829..ace0b27b4e 100644
--- a/compiler/deSugar/Coverage.hs
+++ b/compiler/GHC/HsToCore/Coverage.hs
@@ -10,7 +10,7 @@
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
-module Coverage (addTicksToBinds, hpcInitCode) where
+module GHC.HsToCore.Coverage (addTicksToBinds, hpcInitCode) where
import GhcPrelude as Prelude
diff --git a/compiler/deSugar/ExtractDocs.hs b/compiler/GHC/HsToCore/Docs.hs
index 632207c41f..e08b46729e 100644
--- a/compiler/deSugar/ExtractDocs.hs
+++ b/compiler/GHC/HsToCore/Docs.hs
@@ -6,7 +6,7 @@
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
-module ExtractDocs (extractDocs) where
+module GHC.HsToCore.Docs (extractDocs) where
import GhcPrelude
import Bag
diff --git a/compiler/deSugar/DsExpr.hs b/compiler/GHC/HsToCore/Expr.hs
index 23d53ce3ca..0d927e4e59 100644
--- a/compiler/deSugar/DsExpr.hs
+++ b/compiler/GHC/HsToCore/Expr.hs
@@ -13,27 +13,30 @@ Desugaring expressions.
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
-module DsExpr ( dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds
- , dsValBinds, dsLit, dsSyntaxExpr
- , dsHandleMonadicFailure ) where
+module GHC.HsToCore.Expr
+ ( dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds
+ , dsValBinds, dsLit, dsSyntaxExpr
+ , dsHandleMonadicFailure
+ )
+where
#include "HsVersions.h"
import GhcPrelude
-import Match
-import MatchLit
-import DsBinds
-import DsGRHSs
-import DsListComp
-import DsUtils
-import DsArrows
-import DsMonad
+import GHC.HsToCore.Match
+import GHC.HsToCore.Match.Literal
+import GHC.HsToCore.Binds
+import GHC.HsToCore.GuardedRHSs
+import GHC.HsToCore.ListComp
+import GHC.HsToCore.Utils
+import GHC.HsToCore.Arrows
+import GHC.HsToCore.Monad
import GHC.HsToCore.PmCheck ( checkGuardMatches )
import Name
import NameEnv
import FamInstEnv( topNormaliseType )
-import DsMeta
+import GHC.HsToCore.Quote
import GHC.Hs
-- NB: The desugarer, which straddles the source and Core worlds, sometimes
@@ -119,7 +122,7 @@ ds_val_bind (NonRecursive, hsbinds) body
-- below. Then pattern-match would fail. Urk.)
, isUnliftedHsBind bind
= putSrcSpanDs loc $
- -- see Note [Strict binds checks] in DsBinds
+ -- see Note [Strict binds checks] in GHC.HsToCore.Binds
if is_polymorphic bind
then errDsCoreExpr (poly_bind_err bind)
-- data Ptr a = Ptr Addr#
@@ -155,7 +158,7 @@ ds_val_bind (NonRecursive, hsbinds) body
text "Probable fix: add a type signature"
ds_val_bind (is_rec, binds) _body
- | anyBag (isUnliftedHsBind . unLoc) binds -- see Note [Strict binds checks] in DsBinds
+ | anyBag (isUnliftedHsBind . unLoc) binds -- see Note [Strict binds checks] in GHC.HsToCore.Binds
= ASSERT( isRec is_rec )
errDsCoreExpr $
hang (text "Recursive bindings for unlifted types aren't allowed:")
@@ -228,7 +231,7 @@ dsUnliftedBind bind body = pprPanic "dsLet: unlifted" (ppr bind $$ ppr body)
{-
************************************************************************
* *
-\subsection[DsExpr-vars-and-cons]{Variables, constructors, literals}
+* Variables, constructors, literals *
* *
************************************************************************
-}
@@ -247,7 +250,7 @@ dsLExpr (L loc e)
-- | Variant of 'dsLExpr' that ensures that the result is not levity
-- polymorphic. This should be used when the resulting expression will
-- be an argument to some other function.
--- See Note [Levity polymorphism checking] in DsMonad
+-- See Note [Levity polymorphism checking] in GHC.HsToCore.Monad
-- See Note [Levity polymorphism invariants] in CoreSyn
dsLExprNoLP :: LHsExpr GhcTc -> DsM CoreExpr
dsLExprNoLP (L loc e)
@@ -875,7 +878,7 @@ dsExplicitList elt_ty Nothing xs
-- Don't generate builds when the [] constructor will do
|| not (gopt Opt_EnableRewriteRules dflags) -- Rewrite rules off
-- Don't generate a build if there are no rules to eliminate it!
- -- See Note [Desugaring RULE left hand sides] in Desugar
+ -- See Note [Desugaring RULE left hand sides] in GHC.HsToCore
then return $ mkListExpr elt_ty xs'
else mkBuildExpr elt_ty (mk_build_list xs') }
where
@@ -910,7 +913,7 @@ dsArithSeq expr (FromThenTo from thn to)
{-
Desugar 'do' and 'mdo' expressions (NOT list comprehensions, they're
-handled in DsListComp). Basically does the translation given in the
+handled in GHC.HsToCore.ListComp). Basically does the translation given in the
Haskell 98 report:
-}
diff --git a/compiler/deSugar/DsExpr.hs-boot b/compiler/GHC/HsToCore/Expr.hs-boot
index e3eed65538..b717c1bee8 100644
--- a/compiler/deSugar/DsExpr.hs-boot
+++ b/compiler/GHC/HsToCore/Expr.hs-boot
@@ -1,8 +1,8 @@
-module DsExpr where
-import GHC.Hs ( HsExpr, LHsExpr, LHsLocalBinds, LPat, SyntaxExpr )
-import DsMonad ( DsM, MatchResult )
-import CoreSyn ( CoreExpr )
-import GHC.Hs.Extension ( GhcTc)
+module GHC.HsToCore.Expr where
+import GHC.Hs ( HsExpr, LHsExpr, LHsLocalBinds, LPat, SyntaxExpr )
+import GHC.HsToCore.Monad ( DsM, MatchResult )
+import CoreSyn ( CoreExpr )
+import GHC.Hs.Extension ( GhcTc)
dsExpr :: HsExpr GhcTc -> DsM CoreExpr
dsLExpr, dsLExprNoLP :: LHsExpr GhcTc -> DsM CoreExpr
diff --git a/compiler/deSugar/DsCCall.hs b/compiler/GHC/HsToCore/Foreign/Call.hs
index fc5f10eb4b..abbc9f3f79 100644
--- a/compiler/deSugar/DsCCall.hs
+++ b/compiler/GHC/HsToCore/Foreign/Call.hs
@@ -9,13 +9,15 @@ Desugaring foreign calls
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module DsCCall
- ( dsCCall
- , mkFCall
- , unboxArg
- , boxResult
- , resultWrapper
- ) where
+
+module GHC.HsToCore.Foreign.Call
+ ( dsCCall
+ , mkFCall
+ , unboxArg
+ , boxResult
+ , resultWrapper
+ )
+where
#include "HsVersions.h"
@@ -24,13 +26,13 @@ import GhcPrelude
import CoreSyn
-import DsMonad
+import GHC.HsToCore.Monad
import CoreUtils
import MkCore
import MkId
import ForeignCall
import DataCon
-import DsUtils
+import GHC.HsToCore.Utils
import TcType
import Type
diff --git a/compiler/deSugar/DsForeign.hs b/compiler/GHC/HsToCore/Foreign/Decl.hs
index 5c2b1a8a22..de14f6ee12 100644
--- a/compiler/deSugar/DsForeign.hs
+++ b/compiler/GHC/HsToCore/Foreign/Decl.hs
@@ -3,7 +3,7 @@
(c) The AQUA Project, Glasgow University, 1998
-Desugaring foreign declarations (see also DsCCall).
+Desugaring foreign declarations (see also GHC.HsToCore.Foreign.Call).
-}
{-# LANGUAGE CPP #-}
@@ -13,7 +13,7 @@ Desugaring foreign declarations (see also DsCCall).
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module DsForeign ( dsForeigns ) where
+module GHC.HsToCore.Foreign.Decl ( dsForeigns ) where
#include "HsVersions.h"
import GhcPrelude
@@ -22,8 +22,8 @@ import TcRnMonad -- temp
import CoreSyn
-import DsCCall
-import DsMonad
+import GHC.HsToCore.Foreign.Call
+import GHC.HsToCore.Monad
import GHC.Hs
import DataCon
@@ -72,7 +72,7 @@ is the same as
f :: prim_args -> IO prim_res
f a1 ... an = _ccall_ nm cc a1 ... an
\end{verbatim}
-so we reuse the desugaring code in @DsCCall@ to deal with these.
+so we reuse the desugaring code in @GHC.HsToCore.Foreign.Call@ to deal with these.
-}
type Binding = (Id, CoreExpr) -- No rec/nonrec structure;
@@ -739,7 +739,7 @@ typeTyCon ty
| Just (tc, _) <- tcSplitTyConApp_maybe (unwrapType ty)
= tc
| otherwise
- = pprPanic "DsForeign.typeTyCon" (ppr ty)
+ = pprPanic "GHC.HsToCore.Foreign.Decl.typeTyCon" (ppr ty)
insertRetAddr :: DynFlags -> CCallConv
-> [(SDoc, SDoc, Type, CmmType)]
@@ -793,7 +793,7 @@ getPrimTyOf ty
ASSERT(dataConSourceArity data_con == 1)
ASSERT2(isUnliftedType prim_ty, ppr prim_ty)
prim_ty
- _other -> pprPanic "DsForeign.getPrimTyOf" (ppr ty)
+ _other -> pprPanic "GHC.HsToCore.Foreign.Decl.getPrimTyOf" (ppr ty)
where
rep_ty = unwrapType ty
diff --git a/compiler/deSugar/DsGRHSs.hs b/compiler/GHC/HsToCore/GuardedRHSs.hs
index a424bd9d7b..94821ec68e 100644
--- a/compiler/deSugar/DsGRHSs.hs
+++ b/compiler/GHC/HsToCore/GuardedRHSs.hs
@@ -9,14 +9,14 @@ Matching guarded right-hand-sides (GRHSs)
{-# LANGUAGE CPP #-}
{-# LANGUAGE ViewPatterns #-}
-module DsGRHSs ( dsGuarded, dsGRHSs, dsGRHS, isTrueLHsExpr ) where
+module GHC.HsToCore.GuardedRHSs ( dsGuarded, dsGRHSs, dsGRHS, isTrueLHsExpr ) where
#include "HsVersions.h"
import GhcPrelude
-import {-# SOURCE #-} DsExpr ( dsLExpr, dsLocalBinds )
-import {-# SOURCE #-} Match ( matchSinglePatVar )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsLExpr, dsLocalBinds )
+import {-# SOURCE #-} GHC.HsToCore.Match ( matchSinglePatVar )
import GHC.Hs
import MkCore
@@ -26,8 +26,8 @@ import CoreUtils (bindNonRec)
import BasicTypes (Origin(FromSource))
import DynFlags
import GHC.HsToCore.PmCheck (needToRunPmCheck, addTyCsDs, addPatTmCs, addScrutTmCs)
-import DsMonad
-import DsUtils
+import GHC.HsToCore.Monad
+import GHC.HsToCore.Utils
import Type ( Type )
import Util
import SrcLoc
diff --git a/compiler/deSugar/DsListComp.hs b/compiler/GHC/HsToCore/ListComp.hs
index 35a71ce8e4..a8ed3bbcb3 100644
--- a/compiler/deSugar/DsListComp.hs
+++ b/compiler/GHC/HsToCore/ListComp.hs
@@ -10,28 +10,28 @@ Desugaring list comprehensions, monad comprehensions and array comprehensions
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
-module DsListComp ( dsListComp, dsMonadComp ) where
+module GHC.HsToCore.ListComp ( dsListComp, dsMonadComp ) where
#include "HsVersions.h"
import GhcPrelude
-import {-# SOURCE #-} DsExpr ( dsHandleMonadicFailure, dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds, dsSyntaxExpr )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsHandleMonadicFailure, dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds, dsSyntaxExpr )
import GHC.Hs
import TcHsSyn
import CoreSyn
import MkCore
-import DsMonad -- the monadery used in the desugarer
-import DsUtils
+import GHC.HsToCore.Monad -- the monadery used in the desugarer
+import GHC.HsToCore.Utils
import DynFlags
import CoreUtils
import Id
import Type
import TysWiredIn
-import Match
+import GHC.HsToCore.Match
import PrelNames
import SrcLoc
import Outputable
@@ -154,7 +154,7 @@ dsTransStmt _ = panic "dsTransStmt: Not given a TransStmt"
{-
************************************************************************
* *
-\subsection[DsListComp-ordinary]{Ordinary desugaring of list comprehensions}
+* Ordinary desugaring of list comprehensions *
* *
************************************************************************
@@ -308,7 +308,7 @@ deBindComp pat core_list1 quals core_list2 = do
{-
************************************************************************
* *
-\subsection[DsListComp-foldr-build]{Foldr/Build desugaring of list comprehensions}
+* Foldr/Build desugaring of list comprehensions *
* *
************************************************************************
diff --git a/compiler/deSugar/Match.hs b/compiler/GHC/HsToCore/Match.hs
index d6ddfb894a..16bf73aab8 100644
--- a/compiler/deSugar/Match.hs
+++ b/compiler/GHC/HsToCore/Match.hs
@@ -15,14 +15,17 @@ The @match@ function
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
-module Match ( match, matchEquations, matchWrapper, matchSimply
- , matchSinglePat, matchSinglePatVar ) where
+module GHC.HsToCore.Match
+ ( match, matchEquations, matchWrapper, matchSimply
+ , matchSinglePat, matchSinglePatVar
+ )
+where
#include "HsVersions.h"
import GhcPrelude
-import {-#SOURCE#-} DsExpr (dsLExpr, dsSyntaxExpr)
+import {-#SOURCE#-} GHC.HsToCore.Expr (dsLExpr, dsSyntaxExpr)
import BasicTypes ( Origin(..) )
import DynFlags
@@ -35,16 +38,16 @@ import CoreSyn
import Literal
import CoreUtils
import MkCore
-import DsMonad
-import DsBinds
-import DsGRHSs
-import DsUtils
+import GHC.HsToCore.Monad
+import GHC.HsToCore.Binds
+import GHC.HsToCore.GuardedRHSs
+import GHC.HsToCore.Utils
import Id
import ConLike
import DataCon
import PatSyn
-import MatchCon
-import MatchLit
+import GHC.HsToCore.Match.Constructor
+import GHC.HsToCore.Match.Literal
import Type
import Coercion ( eqCoercion )
import TyCon( isNewTyCon )
@@ -105,7 +108,7 @@ is an embryonic @CoreExpr@ with a ``hole'' at the end for the
final ``else expression''.
\end{itemize}
-There is a data type, @EquationInfo@, defined in module @DsMonad@.
+There is a data type, @EquationInfo@, defined in module @GHC.HsToCore.Monad@.
An experiment with re-ordering this information about equations (in
particular, having the patterns available in column-major order)
@@ -162,7 +165,7 @@ sometimes use that Id in a local binding or as a case binder. So it
should not have an External name; Lint rejects non-top-level binders
with External names (#13043).
-See also Note [Localise pattern binders] in DsUtils
+See also Note [Localise pattern binders] in GHC.HsToCore.Utils
-}
type MatchId = Id -- See Note [Match Ids]
@@ -717,7 +720,7 @@ matchWrapper
\begin{itemize}
\item @do@ patterns, but if the @do@ can fail
it creates another equation if the match can fail
- (see @DsExpr.doDo@ function)
+ (see @GHC.HsToCore.Expr.doDo@ function)
\item @let@ patterns, are treated by @matchSimply@
List Comprension Patterns, are treated by @matchSimply@ also
\end{itemize}
diff --git a/compiler/deSugar/Match.hs-boot b/compiler/GHC/HsToCore/Match.hs-boot
index 6d6cf989df..dbed65dd0d 100644
--- a/compiler/deSugar/Match.hs-boot
+++ b/compiler/GHC/HsToCore/Match.hs-boot
@@ -1,9 +1,9 @@
-module Match where
+module GHC.HsToCore.Match where
import GhcPrelude
import Var ( Id )
import TcType ( Type )
-import DsMonad ( DsM, EquationInfo, MatchResult )
+import GHC.HsToCore.Monad ( DsM, EquationInfo, MatchResult )
import CoreSyn ( CoreExpr )
import GHC.Hs ( LPat, HsMatchContext, MatchGroup, LHsExpr )
import GHC.Hs.Extension ( GhcRn, GhcTc )
diff --git a/compiler/deSugar/MatchCon.hs b/compiler/GHC/HsToCore/Match/Constructor.hs
index b5d5807592..37a9f753a6 100644
--- a/compiler/deSugar/MatchCon.hs
+++ b/compiler/GHC/HsToCore/Match/Constructor.hs
@@ -12,21 +12,21 @@ Pattern-matching constructors
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module MatchCon ( matchConFamily, matchPatSyn ) where
+module GHC.HsToCore.Match.Constructor ( matchConFamily, matchPatSyn ) where
#include "HsVersions.h"
import GhcPrelude
-import {-# SOURCE #-} Match ( match )
+import {-# SOURCE #-} GHC.HsToCore.Match ( match )
import GHC.Hs
-import DsBinds
+import GHC.HsToCore.Binds
import ConLike
import BasicTypes ( Origin(..) )
import TcType
-import DsMonad
-import DsUtils
+import GHC.HsToCore.Monad
+import GHC.HsToCore.Utils
import MkCore ( mkCoreLets )
import Util
import Id
diff --git a/compiler/deSugar/MatchLit.hs b/compiler/GHC/HsToCore/Match/Literal.hs
index a6ec151bfd..350a5ed8eb 100644
--- a/compiler/deSugar/MatchLit.hs
+++ b/compiler/GHC/HsToCore/Match/Literal.hs
@@ -11,23 +11,25 @@ Pattern-matching literal patterns
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module MatchLit ( dsLit, dsOverLit, hsLitKey
- , tidyLitPat, tidyNPat
- , matchLiterals, matchNPlusKPats, matchNPats
- , warnAboutIdentities
- , warnAboutOverflowedOverLit, warnAboutOverflowedLit
- , warnAboutEmptyEnumerations
- ) where
+module GHC.HsToCore.Match.Literal
+ ( dsLit, dsOverLit, hsLitKey
+ , tidyLitPat, tidyNPat
+ , matchLiterals, matchNPlusKPats, matchNPats
+ , warnAboutIdentities
+ , warnAboutOverflowedOverLit, warnAboutOverflowedLit
+ , warnAboutEmptyEnumerations
+ )
+where
#include "HsVersions.h"
import GhcPrelude
-import {-# SOURCE #-} Match ( match )
-import {-# SOURCE #-} DsExpr ( dsExpr, dsSyntaxExpr )
+import {-# SOURCE #-} GHC.HsToCore.Match ( match )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsExpr, dsSyntaxExpr )
-import DsMonad
-import DsUtils
+import GHC.HsToCore.Monad
+import GHC.HsToCore.Utils
import GHC.Hs
@@ -64,8 +66,8 @@ import Data.Proxy
************************************************************************
* *
Desugaring literals
- [used to be in DsExpr, but DsMeta needs it,
- and it's nice to avoid a loop]
+ [used to be in GHC.HsToCore.Expr, but GHC.HsToCore.Quote needs it,
+ and it's nice to avoid a loop]
* *
************************************************************************
diff --git a/compiler/deSugar/DsMonad.hs b/compiler/GHC/HsToCore/Monad.hs
index 998d46395d..4dc7590a47 100644
--- a/compiler/deSugar/DsMonad.hs
+++ b/compiler/GHC/HsToCore/Monad.hs
@@ -3,14 +3,14 @@
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-@DsMonad@: monadery used in desugaring
+Monadery used in desugaring
-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-} -- instance MonadThings is necessarily an orphan
{-# LANGUAGE ViewPatterns #-}
-module DsMonad (
+module GHC.HsToCore.Monad (
DsM, mapM, mapAndUnzipM,
initDs, initDsTc, initTcDsForSolver, initDsWithModGuts, fixDs,
foldlM, foldrM, whenGOptM, unsetGOptM, unsetWOptM, xoptM,
@@ -108,7 +108,7 @@ data EquationInfo
-- ^ The patterns for an equation
--
-- NB: We have /already/ applied 'decideBangHood' to
- -- these patterns. See Note [decideBangHood] in "DsUtils"
+ -- these patterns. See Note [decideBangHood] in GHC.HsToCore.Utils
, eqn_orig :: Origin
-- ^ Was this equation present in the user source?
@@ -314,7 +314,7 @@ At one point, I (Richard) thought we could check in the zonker, but it's hard
to know where precisely are the abstracted variables and the arguments. So
we check in the desugarer, the only place where we can see the Core code and
still report respectable syntax to the user. This covers the vast majority
-of cases; see calls to DsMonad.dsNoLevPoly and friends.
+of cases; see calls to GHC.HsToCore.Monad.dsNoLevPoly and friends.
Levity polymorphism is also prohibited in the types of binders, and the
desugarer checks for this in GHC-generated Ids. (The zonker handles
@@ -322,7 +322,7 @@ the user-writted ids in zonkIdBndr.) This is done in newSysLocalDsNoLP.
The newSysLocalDs variant is used in the vast majority of cases where
the binder is obviously not levity polymorphic, omitting the check.
It would be nice to ASSERT that there is no levity polymorphism here,
-but we can't, because of the fixM in DsArrows. It's all OK, though:
+but we can't, because of the fixM in GHC.HsToCore.Arrows. It's all OK, though:
Core Lint will catch an error here.
However, the desugarer is the wrong place for certain checks. In particular,
@@ -357,7 +357,7 @@ newSysLocalDsNoLP = mk_local (fsLit "ds")
-- this variant should be used when the caller can be sure that the variable type
-- is not levity-polymorphic. It is necessary when the type is knot-tied because
--- of the fixM used in DsArrows. See Note [Levity polymorphism checking]
+-- of the fixM used in GHC.HsToCore.Arrows. See Note [Levity polymorphism checking]
newSysLocalDs = mkSysLocalM (fsLit "ds")
newFailLocalDs = mkSysLocalM (fsLit "fail")
-- the fail variable is used only in a situation where we can tell that
diff --git a/compiler/GHC/HsToCore/PmCheck.hs b/compiler/GHC/HsToCore/PmCheck.hs
index 3c9300c71e..4b1ff614d6 100644
--- a/compiler/GHC/HsToCore/PmCheck.hs
+++ b/compiler/GHC/HsToCore/PmCheck.hs
@@ -47,16 +47,16 @@ import Var (EvVar)
import Coercion
import TcEvidence
import TcType (evVarPred)
-import {-# SOURCE #-} DsExpr (dsExpr, dsLExpr, dsSyntaxExpr)
-import {-# SOURCE #-} DsBinds (dsHsWrapper)
-import DsUtils (selectMatchVar)
-import MatchLit (dsLit, dsOverLit)
-import DsMonad
+import {-# SOURCE #-} GHC.HsToCore.Expr (dsExpr, dsLExpr, dsSyntaxExpr)
+import {-# SOURCE #-} GHC.HsToCore.Binds (dsHsWrapper)
+import GHC.HsToCore.Utils (selectMatchVar)
+import GHC.HsToCore.Match.Literal (dsLit, dsOverLit)
+import GHC.HsToCore.Monad
import Bag
import OrdList
import TyCoRep
import Type
-import DsUtils (isTrueLHsExpr)
+import GHC.HsToCore.Utils (isTrueLHsExpr)
import Maybes
import qualified GHC.LanguageExtensions as LangExt
@@ -482,7 +482,7 @@ translatePat fam_insts x pat = case pat of
translateConPatOut fam_insts x con arg_tys ex_tvs dicts ps
NPat ty (L _ olit) mb_neg _ -> do
- -- See Note [Literal short cut] in MatchLit.hs
+ -- See Note [Literal short cut] in GHC.HsToCore.Match.Literal.hs
-- We inline the Literal short cut for @ty@ here, because @ty@ is more
-- precise than the field of OverLitTc, which is all that dsOverLit (which
-- normally does the literal short cut) can look at. Also @ty@ matches the
@@ -982,8 +982,8 @@ checkGrdTree guards deltas = do
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When checking a match it would be great to have all type and term information
available so we can get more precise results. For this reason we have functions
-`addDictsDs' and `addTmVarCsDs' in DsMonad that store in the environment type and
-term constraints (respectively) as we go deeper.
+`addDictsDs' and `addTmVarCsDs' in GHC.HsToCore.Monad that store in the
+environment type and term constraints (respectively) as we go deeper.
The type constraints we propagate inwards are collected by `collectEvVarsPats'
in GHC.Hs.Pat. This handles bug #4139 ( see example
diff --git a/compiler/GHC/HsToCore/PmCheck/Oracle.hs b/compiler/GHC/HsToCore/PmCheck/Oracle.hs
index a8fc154765..ab0f8ccc29 100644
--- a/compiler/GHC/HsToCore/PmCheck/Oracle.hs
+++ b/compiler/GHC/HsToCore/PmCheck/Oracle.hs
@@ -66,7 +66,7 @@ import Unify (tcMatchTy)
import TcRnTypes (completeMatchConLikes)
import Coercion
import MonadUtils hiding (foldlM)
-import DsMonad hiding (foldlM)
+import GHC.HsToCore.Monad hiding (foldlM)
import FamInst
import FamInstEnv
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/GHC/HsToCore/Quote.hs
index 5473682a40..970fc82463 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/GHC/HsToCore/Quote.hs
@@ -22,25 +22,25 @@
-- a Royal Pain (triggers other recompilation).
-----------------------------------------------------------------------------
-module DsMeta( dsBracket ) where
+module GHC.HsToCore.Quote( dsBracket ) where
#include "HsVersions.h"
import GhcPrelude
-import {-# SOURCE #-} DsExpr ( dsExpr )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsExpr )
-import MatchLit
-import DsMonad
+import GHC.HsToCore.Match.Literal
+import GHC.HsToCore.Monad
import qualified Language.Haskell.TH as TH
import GHC.Hs
import PrelNames
--- To avoid clashes with DsMeta.varName we must make a local alias for
--- OccName.varName we do this by removing varName from the import of
--- OccName above, making a qualified instance of OccName and using
--- OccNameAlias.varName where varName ws previously used in this file.
+-- To avoid clashes with GHC.HsToCore.Quote.varName we must make a local alias
+-- for OccName.varName. We do this by removing varName from the import of OccName
+-- above, making a qualified instance of OccName and using OccNameAlias.varName
+-- where varName ws previously used in this file.
import qualified OccName( isDataOcc, isVarOcc, isTcOcc )
import Module
@@ -72,7 +72,7 @@ import Class
import HscTypes ( MonadThings )
import DataCon
import Var
-import DsBinds
+import GHC.HsToCore.Binds
import GHC.TypeLits
import Data.Kind (Constraint)
@@ -2105,7 +2105,7 @@ globalVar name
mk_varg | OccName.isDataOcc name_occ = mkNameG_dName
| OccName.isVarOcc name_occ = mkNameG_vName
| OccName.isTcOcc name_occ = mkNameG_tcName
- | otherwise = pprPanic "DsMeta.globalVar" (ppr name)
+ | otherwise = pprPanic "GHC.HsToCore.Quote.globalVar" (ppr name)
lookupType :: Name -- Name of type constructor (e.g. (M TH.Exp))
-> MetaM Type -- The type
diff --git a/compiler/deSugar/DsUsage.hs b/compiler/GHC/HsToCore/Usage.hs
index 8d3517410e..f771608a94 100644
--- a/compiler/deSugar/DsUsage.hs
+++ b/compiler/GHC/HsToCore/Usage.hs
@@ -4,7 +4,7 @@
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module DsUsage (
+module GHC.HsToCore.Usage (
-- * Dependency/fingerprinting code (used by GHC.Iface.Utils)
mkUsageInfo, mkUsedNames, mkDependencies
) where
diff --git a/compiler/deSugar/DsUtils.hs b/compiler/GHC/HsToCore/Utils.hs
index 9d6b709dc9..3c95e55b19 100644
--- a/compiler/deSugar/DsUtils.hs
+++ b/compiler/GHC/HsToCore/Utils.hs
@@ -14,7 +14,7 @@ This module exports some utility functions of no great interest.
{-# LANGUAGE ViewPatterns #-}
-- | Utility functions for constructing Core syntax, principally for desugaring
-module DsUtils (
+module GHC.HsToCore.Utils (
EquationInfo(..),
firstPat, shiftEqns,
@@ -46,14 +46,14 @@ module DsUtils (
import GhcPrelude
-import {-# SOURCE #-} Match ( matchSimply )
-import {-# SOURCE #-} DsExpr ( dsLExpr )
+import {-# SOURCE #-} GHC.HsToCore.Match ( matchSimply )
+import {-# SOURCE #-} GHC.HsToCore.Expr ( dsLExpr )
import GHC.Hs
import TcHsSyn
import TcType( tcSplitTyConApp )
import CoreSyn
-import DsMonad
+import GHC.HsToCore.Monad
import CoreUtils
import MkCore
@@ -172,7 +172,7 @@ In fact, even CoreSubst.simplOptExpr will do this, and simpleOptExpr
runs on the output of the desugarer, so all is well by the end of
the desugaring pass.
-See also Note [MatchIds] in Match.hs
+See also Note [MatchIds] in GHC.HsToCore.Match
************************************************************************
* *
@@ -668,7 +668,7 @@ mkSelectorBinds :: [[Tickish Id]] -- ^ ticks to add, possibly
-> CoreExpr -- ^ Expression to which the pattern is bound
-> DsM (Id,[(Id,CoreExpr)])
-- ^ Id the rhs is bound to, for desugaring strict
- -- binds (see Note [Desugar Strict binds] in DsBinds)
+ -- binds (see Note [Desugar Strict binds] in GHC.HsToCore.Binds)
-- and all the desugared binds
mkSelectorBinds ticks pat val_expr
@@ -923,10 +923,10 @@ and
This adjustment is done by decideBangHood,
- * Just before constructing an EqnInfo, in Match
+ * Just before constructing an EqnInfo, in GHC.HsToCore.Match
(matchWrapper and matchSinglePat)
- * When desugaring a pattern-binding in DsBinds.dsHsBind
+ * When desugaring a pattern-binding in GHC.HsToCore.Binds.dsHsBind
Note that it is /not/ done recursively. See the -XStrict
spec in the user manual.
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs
index 10986769ed..943b5a1562 100644
--- a/compiler/GHC/Iface/Ext/Ast.hs
+++ b/compiler/GHC/Iface/Ext/Ast.hs
@@ -25,7 +25,7 @@ import BooleanFormula
import Class ( FunDep )
import CoreUtils ( exprType )
import ConLike ( conLikeName )
-import Desugar ( deSugarExpr )
+import GHC.HsToCore ( deSugarExpr )
import FieldLabel
import GHC.Hs
import HscTypes
diff --git a/compiler/GHC/Iface/Utils.hs b/compiler/GHC/Iface/Utils.hs
index c90cfe13a5..bf221bd88c 100644
--- a/compiler/GHC/Iface/Utils.hs
+++ b/compiler/GHC/Iface/Utils.hs
@@ -68,7 +68,7 @@ import GHC.Iface.Load
import GHC.CoreToIface
import FlagChecker
-import DsUsage ( mkUsageInfo, mkUsedNames, mkDependencies )
+import GHC.HsToCore.Usage ( mkUsageInfo, mkUsedNames, mkDependencies )
import Id
import Annotations
import CoreSyn
@@ -109,7 +109,7 @@ import Fingerprint
import Exception
import UniqSet
import Packages
-import ExtractDocs
+import GHC.HsToCore.Docs
import Control.Monad
import Data.Function
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs
index 333e3c3f5a..70b466ef2b 100644
--- a/compiler/GHC/Rename/Expr.hs
+++ b/compiler/GHC/Rename/Expr.hs
@@ -704,7 +704,7 @@ postProcessStmtsForApplicativeDo ctxt stmts
; let is_do_expr | DoExpr <- ctxt = True
| otherwise = False
-- don't apply the transformation inside TH brackets, because
- -- DsMeta does not handle ApplicativeDo.
+ -- GHC.HsToCore.Quote does not handle ApplicativeDo.
; in_th_bracket <- isBrackStage <$> getStage
; if ado_is_on && is_do_expr && not in_th_bracket
then do { traceRn "ppsfa" (ppr stmts)
@@ -984,7 +984,7 @@ lookupStmtNamePoly ctxt name
-- | Is this a context where we respect RebindableSyntax?
-- but ListComp are never rebindable
--- Neither is ArrowExpr, which has its own desugarer in DsArrows
+-- Neither is ArrowExpr, which has its own desugarer in GHC.HsToCore.Arrows
rebindableContext :: HsStmtContext GhcRn -> Bool
rebindableContext ctxt = case ctxt of
ListComp -> False
@@ -1511,7 +1511,7 @@ ApplicativeDo touches a few phases in the compiler:
* Desugarer: Any do-block which contains applicative statements is desugared
as outlined above, to use the Applicative combinators.
- Relevant module: DsExpr
+ Relevant module: GHC.HsToCore.Expr
-}
diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs
index 808cd21803..7c9077d516 100644
--- a/compiler/GHC/ThToHs.hs
+++ b/compiler/GHC/ThToHs.hs
@@ -1594,8 +1594,9 @@ The hsSyn representation of parsed source explicitly contains all the original
parens, as written in the source.
When a Template Haskell (TH) splice is evaluated, the original splice is first
-renamed and type checked and then finally converted to core in DsMeta. This core
-is then run in the TH engine, and the result comes back as a TH AST.
+renamed and type checked and then finally converted to core in
+GHC.HsToCore.Quote. This core is then run in the TH engine, and the result
+comes back as a TH AST.
In the process, all parens are stripped out, as they are not needed.
@@ -1996,11 +1997,11 @@ with the following parts:
Due to the two forall quantifiers and constraint contexts (either of
which might be empty), pattern synonym type signatures are treated
-specially in `deSugar/DsMeta.hs`, `hsSyn/Convert.hs`, and
+specially in `GHC.HsToCore.Quote`, `GHC.ThToHs`, and
`typecheck/TcSplice.hs`:
(a) When desugaring a pattern synonym from HsSyn to TH.Dec in
- `deSugar/DsMeta.hs`, we represent its *full* type signature in TH, i.e.:
+ `GHC.HsToCore.Quote`, we represent its *full* type signature in TH, i.e.:
ForallT univs reqs (ForallT exis provs ty)
(where ty is the AST representation of t1 -> t2 -> ... -> tn -> t)
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs
index 046b208983..bff97a1887 100644
--- a/compiler/basicTypes/BasicTypes.hs
+++ b/compiler/basicTypes/BasicTypes.hs
@@ -1327,7 +1327,7 @@ if an Id has defaultInlinePragma it means the user didn't specify anything.
If inl_inline = Inline or Inlineable, then the Id should have an InlineRule unfolding.
-If you want to know where InlinePragmas take effect: Look in DsBinds.makeCorePair
+If you want to know where InlinePragmas take effect: Look in GHC.HsToCore.Binds.makeCorePair
Note [inl_inline and inl_act]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1526,7 +1526,7 @@ competesWith (ActiveAfter _ a) (ActiveAfter _ b) = a >= b
{- Note [Competing activations]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes a RULE and an inlining may compete, or two RULES.
-See Note [Rules and inlining/other rules] in Desugar.
+See Note [Rules and inlining/other rules] in GHC.HsToCore.
We say that act1 "competes with" act2 iff
act1 is active in the phase when act2 *becomes* active
@@ -1615,7 +1615,7 @@ integralFractionalLit neg i = FL { fl_text = SourceText (show i),
fl_value = fromInteger i }
-- Comparison operations are needed when grouping literals
--- for compiling pattern-matching (module MatchLit)
+-- for compiling pattern-matching (module GHC.HsToCore.Match.Literal)
instance Eq IntegralLit where
(==) = (==) `on` il_value
diff --git a/compiler/basicTypes/DataCon.hs b/compiler/basicTypes/DataCon.hs
index fcc5fcfed0..4c429ea61d 100644
--- a/compiler/basicTypes/DataCon.hs
+++ b/compiler/basicTypes/DataCon.hs
@@ -1310,7 +1310,8 @@ dataConInstOrigArgTys
-- equality constraints or dicts
-> [Type]
-- For vanilla datacons, it's all quite straightforward
--- But for the call in MatchCon, we really do want just the value args
+-- But for the call in GHC.HsToCore.Match.Constructor, we really do want just
+-- the value args
dataConInstOrigArgTys dc@(MkData {dcOrigArgTys = arg_tys,
dcUnivTyVars = univ_tvs,
dcExTyCoVars = ex_tvs}) inst_tys
diff --git a/compiler/basicTypes/Id.hs b/compiler/basicTypes/Id.hs
index 9efc512997..ff32323fd9 100644
--- a/compiler/basicTypes/Id.hs
+++ b/compiler/basicTypes/Id.hs
@@ -565,7 +565,7 @@ lambdas if it is not applied to enough arguments; e.g. (#14561)
bad :: forall (a :: TYPE r). a -> a
bad = unsafeCoerce#
-The desugar has special magic to detect such cases: DsExpr.badUseOfLevPolyPrimop.
+The desugar has special magic to detect such cases: GHC.HsToCore.Expr.badUseOfLevPolyPrimop.
And we want that magic to apply to levity-polymorphic compulsory-inline things.
The easiest way to do this is for hasNoBinding to return True of all things
that have compulsory unfolding. Some Ids with a compulsory unfolding also
diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index 34183cbeab..a0b84a6aa5 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -354,7 +354,7 @@ argument is not levity-polymorphic (which it can't be, according to
Note [Levity polymorphism invariants] in CoreSyn), and it's saturated,
no levity-polymorphic code ends up in the code generator. The saturation
condition is effectively checked by Note [Detecting forced eta expansion]
-in DsExpr.
+in GHC.HsToCore.Expr.
However, if we make a *wrapper* for a newtype, we get into trouble.
The saturation condition is no longer checked (because hasNoBinding
@@ -1510,7 +1510,7 @@ Note [seqId magic]
a) Its fixity is set in GHC.Iface.Load.ghcPrimIface
b) It has quite a bit of desugaring magic.
- See DsUtils.hs Note [Desugaring seq (1)] and (2) and (3)
+ See GHC.HsToCore.Utils.hs Note [Desugaring seq (1)] and (2) and (3)
c) There is some special rule handing: Note [User-defined RULES for seq]
diff --git a/compiler/basicTypes/NameCache.hs b/compiler/basicTypes/NameCache.hs
index 3bbdf745c8..8b63e3d687 100644
--- a/compiler/basicTypes/NameCache.hs
+++ b/compiler/basicTypes/NameCache.hs
@@ -66,8 +66,8 @@ are two reasons why we might look up an Orig RdrName for built-in syntax,
turned into an Orig RdrName.
* Template Haskell turns a BuiltInSyntax Name into a TH.NameG
- (DsMeta.globalVar), and parses a NameG into an Orig RdrName
- (Convert.thRdrName). So, e.g. $(do { reify '(,); ... }) will
+ (GHC.HsToCore.Quote.globalVar), and parses a NameG into an Orig RdrName
+ (GHC.ThToHs.thRdrName). So, e.g. $(do { reify '(,); ... }) will
go this route (#8954).
-}
diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs
index c516799bef..2c775353be 100644
--- a/compiler/coreSyn/CoreOpt.hs
+++ b/compiler/coreSyn/CoreOpt.hs
@@ -669,7 +669,7 @@ When the user writes `RULES map coerce = coerce` as a rule, the rule
will only ever match if simpleOptExpr replaces coerce by its unfolding
on the LHS, because that is the core that the rule matching engine
will find. So do that for everything that has a compulsory
-unfolding. Also see Note [Desugaring coerce as cast] in Desugar.
+unfolding. Also see Note [Desugaring coerce as cast] in GHC.HsToCore.
However, we don't want to inline 'seq', which happens to also have a
compulsory unfolding, so we only do this unfolding only for things
diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs
index 669026c641..ec55f688a9 100644
--- a/compiler/coreSyn/CoreSubst.hs
+++ b/compiler/coreSyn/CoreSubst.hs
@@ -739,7 +739,7 @@ and abstractions to get back to an Id, with getIdFromTrivialExpr.
Second, we have to ensure that we never try to substitute a literal
for an Id in a breakpoint. We ensure this by never storing an Id with
-an unlifted type in a Breakpoint - see Coverage.mkTickish.
+an unlifted type in a Breakpoint - see GHC.HsToCore.Coverage.mkTickish.
Breakpoints can't handle free variables with unlifted types anyway.
-}
diff --git a/compiler/coreSyn/CoreSyn.hs b/compiler/coreSyn/CoreSyn.hs
index ffc9c6867e..72c7e5211a 100644
--- a/compiler/coreSyn/CoreSyn.hs
+++ b/compiler/coreSyn/CoreSyn.hs
@@ -560,7 +560,7 @@ For example
\(r::RuntimeRep). \(a::TYPE r). \(x::a). e
is illegal because x's type has kind (TYPE r), which has 'r' free.
-See Note [Levity polymorphism checking] in DsMonad to see where these
+See Note [Levity polymorphism checking] in GHC.HsToCore.Monad to see where these
invariants are established for user-written code.
Note [CoreSyn let goal]
diff --git a/compiler/deSugar/DsBinds.hs-boot b/compiler/deSugar/DsBinds.hs-boot
deleted file mode 100644
index 71c0040039..0000000000
--- a/compiler/deSugar/DsBinds.hs-boot
+++ /dev/null
@@ -1,6 +0,0 @@
-module DsBinds where
-import DsMonad ( DsM )
-import CoreSyn ( CoreExpr )
-import TcEvidence (HsWrapper)
-
-dsHsWrapper :: HsWrapper -> DsM (CoreExpr -> CoreExpr)
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 75172c32a0..2f27d7d116 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -164,7 +164,6 @@ Library
basicTypes
cmm
coreSyn
- deSugar
iface
llvmGen
main
@@ -324,22 +323,22 @@ Library
GHC.HsToCore.PmCheck.Ppr
GHC.HsToCore.PmCheck.Types
GHC.HsToCore.PmCheck
- Coverage
- Desugar
- DsArrows
- DsBinds
- DsCCall
- DsExpr
- DsForeign
- DsGRHSs
- DsListComp
- DsMonad
- DsUsage
- DsUtils
- ExtractDocs
- Match
- MatchCon
- MatchLit
+ GHC.HsToCore.Coverage
+ GHC.HsToCore
+ GHC.HsToCore.Arrows
+ GHC.HsToCore.Binds
+ GHC.HsToCore.Foreign.Call
+ GHC.HsToCore.Expr
+ GHC.HsToCore.Foreign.Decl
+ GHC.HsToCore.GuardedRHSs
+ GHC.HsToCore.ListComp
+ GHC.HsToCore.Monad
+ GHC.HsToCore.Usage
+ GHC.HsToCore.Utils
+ GHC.HsToCore.Docs
+ GHC.HsToCore.Match
+ GHC.HsToCore.Match.Constructor
+ GHC.HsToCore.Match.Literal
GHC.Hs
GHC.Hs.Binds
GHC.Hs.Decls
@@ -526,7 +525,7 @@ Library
TcSplice
Class
Coercion
- DsMeta
+ GHC.HsToCore.Quote
THNames
FamInstEnv
FunDeps
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 5db264254c..6fbf019456 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -965,7 +965,7 @@ runPhase (RealPhase (Unlit sf)) input_fn dflags
-- escape the characters \, ", and ', but don't try to escape
-- Unicode or anything else (so we don't use Util.charToC
-- here). If we get this wrong, then in
- -- Coverage.isGoodTickSrcSpan where we check that the filename in
+ -- GHC.HsToCore.Coverage.isGoodTickSrcSpan where we check that the filename in
-- a SrcLoc is the same as the source filenaame, the two will
-- look bogusly different. See test:
-- libraries/hpc/tests/function/subdir/tough2.hs
@@ -2308,7 +2308,7 @@ Introduction
4) -fhpc
At some point during compilation with -fhpc, in the function
- `deSugar.Coverage.isGoodTickSrcSpan`, we compare the filename that a
+ `GHC.HsToCore.Coverage.isGoodTickSrcSpan`, we compare the filename that a
`SrcSpan` refers to with the name of the file we are currently compiling.
For some reason I don't yet understand, they can sometimes legitimally be
different, and then hpc ignores that SrcSpan.
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 8e7a9db87a..aa4a6a4875 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -120,7 +120,7 @@ import NameCache ( initNameCache )
import GHC.Iface.Load ( ifaceStats, initExternalPackageState )
import PrelInfo
import GHC.Iface.Utils
-import Desugar
+import GHC.HsToCore
import SimplCore
import GHC.Iface.Tidy
import GHC.CoreToStg.Prep
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 33f827e2c6..223b566031 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -2326,7 +2326,7 @@ class Monad m => MonadThings m where
lookupTyCon :: Name -> m TyCon
lookupTyCon = liftM tyThingTyCon . lookupThing
--- Instance used in DsMeta
+-- Instance used in GHC.HsToCore.Quote
instance MonadThings m => MonadThings (ReaderT s m) where
lookupThing = lift . lookupThing
@@ -3237,7 +3237,7 @@ for the same TyCon:
And looking up the values in the CompleteMatchMap associated with Boolean
would give you [CompleteMatch [F, T1] Boolean, CompleteMatch [F, T2] Boolean].
-dsGetCompleteMatches in DsMeta accomplishes this lookup.
+dsGetCompleteMatches in GHC.HsToCore.Quote accomplishes this lookup.
Also see Note [Typechecking Complete Matches] in TcBinds for a more detailed
explanation for how GHC ensures that all the conlikes in a COMPLETE set are
diff --git a/compiler/prelude/THNames.hs b/compiler/prelude/THNames.hs
index 0da1c5200a..4b38dbc39a 100644
--- a/compiler/prelude/THNames.hs
+++ b/compiler/prelude/THNames.hs
@@ -24,7 +24,7 @@ import FastString
templateHaskellNames :: [Name]
-- The names that are implicitly mentioned by ``bracket''
--- Should stay in sync with the import list of DsMeta
+-- Should stay in sync with the import list of GHC.HsToCore.Quote
templateHaskellNames = [
returnQName, bindQName, sequenceQName, newNameName, liftName, liftTypedName,
@@ -562,7 +562,7 @@ decsQTyConName = libTc (fsLit "DecsQ") decsQTyConKey -- Q [De
typeQTyConName = libTc (fsLit "TypeQ") typeQTyConKey
patQTyConName = libTc (fsLit "PatQ") patQTyConKey
--- These are used in DsMeta but always wrapped in a type variable
+-- These are used in GHC.HsToCore.Quote but always wrapped in a type variable
stmtTyConName = thTc (fsLit "Stmt") stmtTyConKey
conTyConName = thTc (fsLit "Con") conTyConKey
bangTypeTyConName = thTc (fsLit "BangType") bangTypeTyConKey
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index bec29ebc76..a14fcc0732 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -702,7 +702,7 @@ Note [One-tuples]
GHC supports both boxed and unboxed one-tuples:
- Unboxed one-tuples are sometimes useful when returning a
single value after CPR analysis
- - A boxed one-tuple is used by DsUtils.mkSelectorBinds, when
+ - A boxed one-tuple is used by GHC.HsToCore.Utils.mkSelectorBinds, when
there is just one binder
Basically it keeps everything uniform.
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index 6e391d3fe2..f90ffea54d 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -75,7 +75,7 @@ Note [Overall plumbing for rules]
locally-declared rules for imported Ids.
- Locally-declared rules for locally-declared Ids are attached to
the IdInfo for that Id. See Note [Attach rules to local ids] in
- DsBinds
+ GHC.HsToCore.Binds
* GHC.Iface.Tidy strips off all the rules from local Ids and adds them to
mg_rules, so that the ModGuts has *all* the locally-declared rules.
diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs
index 557ca5e2fe..f60405e8be 100644
--- a/compiler/typecheck/TcEvidence.hs
+++ b/compiler/typecheck/TcEvidence.hs
@@ -212,7 +212,7 @@ data HsWrapper
-- The TcType is the "from" type of the first wrapper
-- The SDoc explains the circumstances under which we have created this
-- WpFun, in case we run afoul of levity polymorphism restrictions in
- -- the desugarer. See Note [Levity polymorphism checking] in DsMonad
+ -- the desugarer. See Note [Levity polymorphism checking] in GHC.HsToCore.Monad
| WpCast TcCoercionR -- A cast: [] `cast` co
-- Guaranteed not the identity coercion
@@ -782,7 +782,7 @@ Important Details:
- An EvCallStack term desugars to a CoreExpr of type `IP "some str" CallStack`.
The desugarer will need to unwrap the IP newtype before pushing a new
- call-site onto a given stack (See DsBinds.dsEvCallStack)
+ call-site onto a given stack (See GHC.HsToCore.Binds.dsEvCallStack)
- When we emit a new wanted CallStack from rule (2) we set its origin to
`IPOccOrigin ip_name` instead of the original `OccurrenceOf func`
diff --git a/compiler/typecheck/TcHoleErrors.hs b/compiler/typecheck/TcHoleErrors.hs
index ba8fa30eb1..1008bc760c 100644
--- a/compiler/typecheck/TcHoleErrors.hs
+++ b/compiler/typecheck/TcHoleErrors.hs
@@ -51,7 +51,7 @@ import Data.Graph ( graphFromEdges, topSort )
import TcSimplify ( simpl_top, runTcSDeriveds )
import TcUnify ( tcSubType_NC )
-import ExtractDocs ( extractDocs )
+import GHC.HsToCore.Docs ( extractDocs )
import qualified Data.Map as Map
import GHC.Hs.Doc ( unpackHDS, DeclDocMap(..) )
import HscTypes ( ModIface_(..) )
diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs
index 3ae4e63fc6..ea533d578e 100644
--- a/compiler/typecheck/TcHsSyn.hs
+++ b/compiler/typecheck/TcHsSyn.hs
@@ -1895,7 +1895,7 @@ zonkTcMethInfoToMethInfoX ze (name, ty, gdm_spec)
---------------------------------------
{- Note [Zonking the LHS of a RULE]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also DsBinds Note [Free tyvars on rule LHS]
+See also GHC.HsToCore.Binds Note [Free tyvars on rule LHS]
We need to gather the type variables mentioned on the LHS so we can
quantify over them. Example:
@@ -1918,7 +1918,7 @@ We do this in two stages.
ZonkEnv. (This is in fact the whole reason that the ZonkEnv has a
UnboundTyVarZonker.)
-* In DsBinds, we quantify over it. See DsBinds
+* In GHC.HsToCore.Binds, we quantify over it. See GHC.HsToCore.Binds
Note [Free tyvars on rule LHS]
Quantifying here is awkward because (a) the data type is big and (b)
diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs
index 96775696a9..21e1ba81ba 100644
--- a/compiler/typecheck/TcInstDcls.hs
+++ b/compiler/typecheck/TcInstDcls.hs
@@ -1163,7 +1163,7 @@ addDFunPrags dfun_id sc_meth_ids
con_app = mkLams dfun_bndrs $
mkApps (Var (dataConWrapId dict_con)) dict_args
-- mkApps is OK because of the checkForLevPoly call in checkValidClass
- -- See Note [Levity polymorphism checking] in DsMonad
+ -- See Note [Levity polymorphism checking] in GHC.HsToCore.Monad
dict_args = map Type inst_tys ++
[mkVarApps (Var id) dfun_bndrs | id <- sc_meth_ids]
diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs
index 52599c925c..85a59b697a 100644
--- a/compiler/typecheck/TcMType.hs
+++ b/compiler/typecheck/TcMType.hs
@@ -2333,7 +2333,7 @@ tidySigSkol env cx ty tv_prs
* *
*************************************************************************
-See Note [Levity polymorphism checking] in DsMonad
+See Note [Levity polymorphism checking] in GHC.HsToCore.Monad
-}
@@ -2354,7 +2354,7 @@ ensureNotLevPoly ty doc
-- forall a. a. See, for example, test ghci/scripts/T9140
checkForLevPoly doc ty
- -- See Note [Levity polymorphism checking] in DsMonad
+ -- See Note [Levity polymorphism checking] in GHC.HsToCore.Monad
checkForLevPoly :: SDoc -> Type -> TcM ()
checkForLevPoly = checkForLevPolyX addErr
diff --git a/compiler/typecheck/TcPatSyn.hs b/compiler/typecheck/TcPatSyn.hs
index ff90b473b2..129a0e5f10 100644
--- a/compiler/typecheck/TcPatSyn.hs
+++ b/compiler/typecheck/TcPatSyn.hs
@@ -1093,7 +1093,7 @@ Note [Record PatSyn Desugaring]
It is important that prov_theta comes before req_theta as this ordering is used
when desugaring record pattern synonym updates.
-Any change to this ordering should make sure to change deSugar/DsExpr.hs if you
+Any change to this ordering should make sure to change GHC.HsToCore.Expr if you
want to avoid difficult to decipher core lint errors!
-}
diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs
index 4bf9ad90cf..d346020963 100644
--- a/compiler/typecheck/TcRnMonad.hs
+++ b/compiler/typecheck/TcRnMonad.hs
@@ -242,7 +242,7 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this
-- We want to serialize the documentation in the .hi-files,
-- and need to extract it from the renamed syntax first.
- -- See 'ExtractDocs.extractDocs'.
+ -- See 'GHC.HsToCore.Docs.extractDocs'.
| gopt Opt_Haddock dflags = Just empty_val
| keep_rn_syntax = Just empty_val
diff --git a/compiler/typecheck/TcSigs.hs b/compiler/typecheck/TcSigs.hs
index 1e284ec0a7..3558ebd733 100644
--- a/compiler/typecheck/TcSigs.hs
+++ b/compiler/typecheck/TcSigs.hs
@@ -668,7 +668,7 @@ Note that
-From the TcSpecPrag, in DsBinds we generate a binding for f_spec and a RULE:
+From the TcSpecPrag, in GHC.HsToCore.Binds we generate a binding for f_spec and a RULE:
f_spec :: Int -> b -> Int
f_spec = wrap<f rhs>
diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs
index 485948a5a3..ea848d391f 100644
--- a/compiler/typecheck/TcSplice.hs
+++ b/compiler/typecheck/TcSplice.hs
@@ -99,8 +99,8 @@ import DataCon
import TcEvidence
import Id
import IdInfo
-import DsExpr
-import DsMonad
+import GHC.HsToCore.Expr
+import GHC.HsToCore.Monad
import GHC.Serialized
import ErrUtils
import Util
@@ -179,7 +179,7 @@ tcTypedBracket rn_expr brack@(TExpBr _ expr) res_ty
; m_var <- mkTyVarTy <$> mkMetaTyVar
-- Make sure the type variable satisfies Quote
; ev_var <- emitQuoteWanted m_var
- -- Bundle them together so they can be used in DsMeta for desugaring
+ -- Bundle them together so they can be used in GHC.HsToCore.Quote for desugaring
-- brackets.
; let wrapper = QuoteWrapper ev_var m_var
-- Typecheck expr to make sure it is valid,
@@ -380,7 +380,7 @@ The life cycle of a un-typed bracket:
In both cases, desugaring happens like this:
- * HsTcBracketOut is desugared by DsMeta.dsBracket. It
+ * HsTcBracketOut is desugared by GHC.HsToCore.Quote.dsBracket. It
a) Extends the ds_meta environment with the PendingSplices
attached to the bracket
@@ -395,10 +395,10 @@ In both cases, desugaring happens like this:
${n}(e). The name is initialised to an (Unqual "splice") when the
splice is created; the renamer gives it a unique.
- * When DsMeta (used to desugar the body of the bracket) comes across
+ * When GHC.HsToCore.Quote (used to desugar the body of the bracket) comes across
a splice, it looks up the splice's Name, n, in the ds_meta envt,
to find an (HsExpr Id) that should be substituted for the splice;
- it just desugars it to get a CoreExpr (DsMeta.repSplice).
+ it just desugars it to get a CoreExpr (GHC.HsToCore.Quote.repSplice).
Example:
Source: f = [| Just $(g 3) |]
@@ -511,7 +511,7 @@ returned together in a `QuoteWrapper` and then passed along to two further place
during compilation:
1. Typechecking nested splices (immediately in tcPendingSplice)
-2. Desugaring quotations (see DsMeta)
+2. Desugaring quotations (see GHC.HsToCore.Quote)
`tcPendingSplice` takes the `m` type variable as an argument and checks
each nested splice against this variable `m`. During this
diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index 3048d6178d..da4cbdb981 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -3956,7 +3956,7 @@ checkValidClass cls
-- method in a dictionary
-- example of what this prevents:
-- class BoundedX (a :: TYPE r) where minBound :: a
- -- See Note [Levity polymorphism checking] in DsMonad
+ -- See Note [Levity polymorphism checking] in GHC.HsToCore.Monad
; checkForLevPoly empty tau1
; unless constrained_class_methods $
diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs
index 8302c2ba4f..81e5f4db6f 100644
--- a/ghc/GHCi/UI/Info.hs
+++ b/ghc/GHCi/UI/Info.hs
@@ -32,7 +32,7 @@ import Prelude hiding (mod,(<>))
import System.Directory
import qualified CoreUtils
-import Desugar
+import GHC.HsToCore
import DynFlags (HasDynFlags(..))
import FastString
import GHC
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 0abe15f3ea..18300c2d46 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -677,8 +677,9 @@ instance Quasi Q where
----------------------------------------------------
--- The following operations are used solely in DsMeta when desugaring brackets
--- They are not necessary for the user, who can use ordinary return and (>>=) etc
+-- The following operations are used solely in GHC.HsToCore.Quote when
+-- desugaring brackets. They are not necessary for the user, who can use
+-- ordinary return and (>>=) etc
sequenceQ :: forall m . Monad m => forall a . [m a] -> m [a]
sequenceQ = sequence