summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-19 10:28:01 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-07 18:36:49 -0400
commit255418da5d264fb2758bc70925adb2094f34adc3 (patch)
tree39e3d7f84571e750f2a087c1bc2ab87198e9b147 /compiler/GHC/Hs
parent3d2991f8b4c1b686323b2c9452ce845a60b8d94c (diff)
downloadhaskell-255418da5d264fb2758bc70925adb2094f34adc3.tar.gz
Modules: type-checker (#13009)
Update Haddock submodule
Diffstat (limited to 'compiler/GHC/Hs')
-rw-r--r--compiler/GHC/Hs/Binds.hs16
-rw-r--r--compiler/GHC/Hs/Decls.hs14
-rw-r--r--compiler/GHC/Hs/Expr.hs12
-rw-r--r--compiler/GHC/Hs/Lit.hs2
-rw-r--r--compiler/GHC/Hs/Pat.hs8
-rw-r--r--compiler/GHC/Hs/Types.hs14
-rw-r--r--compiler/GHC/Hs/Utils.hs10
7 files changed, 38 insertions, 38 deletions
diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs
index efd4b7cd95..1471227528 100644
--- a/compiler/GHC/Hs/Binds.hs
+++ b/compiler/GHC/Hs/Binds.hs
@@ -33,7 +33,7 @@ import {-# SOURCE #-} GHC.Hs.Pat ( LPat )
import GHC.Hs.Extension
import GHC.Hs.Types
import GHC.Core
-import TcEvidence
+import GHC.Tc.Types.Evidence
import GHC.Core.Type
import GHC.Types.Name.Set
import GHC.Types.Basic
@@ -198,7 +198,7 @@ data HsBindLR idL idR
-- and variables @f = \x -> e@
-- and strict variables @!x = x + 1@
--
- -- Reason 1: Special case for type inference: see 'TcBinds.tcMonoBinds'.
+ -- Reason 1: Special case for type inference: see 'GHC.Tc.Gen.Bind.tcMonoBinds'.
--
-- Reason 2: Instance decls can only have FunBinds, which is convenient.
-- If you change this, you'll need to change e.g. rnMethodBinds
@@ -291,7 +291,7 @@ data HsBindLR idL idR
abs_exports :: [ABExport idL],
-- | Evidence bindings
- -- Why a list? See TcInstDcls
+ -- Why a list? See GHC.Tc.TyCl.Instance
-- Note [Typechecking plan for instance declarations]
abs_ev_binds :: [TcEvBinds],
@@ -590,7 +590,7 @@ This ultimately desugars to something like this:
The abe_wrap field deals with impedance-matching between
(/\a b. case tup a b of { (f,g) -> f })
and the thing we really want, which may have fewer type
-variables. The action happens in TcBinds.mkExport.
+variables. The action happens in GHC.Tc.Gen.Bind.mkExport.
Note [Bind free vars]
~~~~~~~~~~~~~~~~~~~~~
@@ -598,14 +598,14 @@ The bind_fvs field of FunBind and PatBind records the free variables
of the definition. It is used for the following purposes
a) Dependency analysis prior to type checking
- (see TcBinds.tc_group)
+ (see GHC.Tc.Gen.Bind.tc_group)
b) Deciding whether we can do generalisation of the binding
- (see TcBinds.decideGeneralisationPlan)
+ (see GHC.Tc.Gen.Bind.decideGeneralisationPlan)
c) Deciding whether the binding can be used in static forms
- (see TcExpr.checkClosedInStaticForm for the HsStatic case and
- TcBinds.isClosedBndrGroup).
+ (see GHC.Tc.Gen.Expr.checkClosedInStaticForm for the HsStatic case and
+ GHC.Tc.Gen.Bind.isClosedBndrGroup).
Specifically,
diff --git a/compiler/GHC/Hs/Decls.hs b/compiler/GHC/Hs/Decls.hs
index 07cdb82a91..8a5cc16fbe 100644
--- a/compiler/GHC/Hs/Decls.hs
+++ b/compiler/GHC/Hs/Decls.hs
@@ -201,7 +201,7 @@ An `HsGroup p` stores every top-level fixity declarations in one of two places:
The story for fixity signatures for class methods is made slightly complicated
by the fact that they can appear both inside and outside of the class itself,
and both forms of fixity signatures are considered top-level. This matters
-in `GHC.Rename.Source.rnSrcDecls`, which must create a fixity environment out
+in `GHC.Rename.Module.rnSrcDecls`, which must create a fixity environment out
of all top-level fixity signatures before doing anything else. Therefore,
`rnSrcDecls` must be aware of both (1) and (2) above. The
`hsGroupTopLevelFixitySigs` function is responsible for collecting this
@@ -492,7 +492,7 @@ Each instance declaration gives rise to one dictionary function binding.
The type checker makes up new source-code instance declarations
(e.g. from 'deriving' or generic default methods --- see
-TcInstDcls.tcInstDecls1). So we can't generate the names for
+GHC.Tc.TyCl.Instance.tcInstDecls1). So we can't generate the names for
dictionary functions in advance (we don't know how many we need).
On the other hand for interface-file instance declarations, the decl
@@ -962,7 +962,7 @@ Invariants
ones.
See Note [Dependency analysis of type, class, and instance decls]
-in GHC.Rename.Source for more info.
+in GHC.Rename.Module for more info.
-}
-- | Type or Class Group
@@ -1284,7 +1284,7 @@ type LHsDerivingClause pass = Located (HsDerivingClause pass)
-- 'ApiAnnotation.AnnAnyClass', 'Api.AnnNewtype',
-- 'ApiAnnotation.AnnOpen','ApiAnnotation.AnnClose'
data HsDerivingClause pass
- -- See Note [Deriving strategies] in TcDeriv
+ -- See Note [Deriving strategies] in GHC.Tc.Deriv
= HsDerivingClause
{ deriv_clause_ext :: XCHsDerivingClause pass
, deriv_clause_strategy :: Maybe (LDerivStrategy pass)
@@ -1478,7 +1478,7 @@ There's a wrinkle in ConDeclGADT
con_args = PrefixCon []
con_res_ty = a :*: (b -> (a :*: (b -> (a :+: b))))
- - In the renamer (GHC.Rename.Source.rnConDecl), we unravel it after
+ - In the renamer (GHC.Rename.Module.rnConDecl), we unravel it after
operator fixities are sorted. So we generate. So we end
up with
con_args = PrefixCon [ a :*: b, a :*: b ]
@@ -1963,7 +1963,7 @@ data DerivDecl pass = DerivDecl
--
-- Which signifies that the context should be inferred.
- -- See Note [Inferring the instance context] in TcDerivInfer.
+ -- See Note [Inferring the instance context] in GHC.Tc.Deriv.Infer.
, deriv_strategy :: Maybe (LDerivStrategy pass)
, deriv_overlap_mode :: Maybe (Located OverlapMode)
@@ -2004,7 +2004,7 @@ type LDerivStrategy pass = Located (DerivStrategy pass)
-- | Which technique the user explicitly requested when deriving an instance.
data DerivStrategy pass
- -- See Note [Deriving strategies] in TcDeriv
+ -- See Note [Deriving strategies] in GHC.Tc.Deriv
= StockStrategy -- ^ GHC's \"standard\" strategy, which is to implement a
-- custom instance for the data type. This only works
-- for certain types that GHC knows about (e.g., 'Eq',
diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs
index c34e7eb809..478ed58364 100644
--- a/compiler/GHC/Hs/Expr.hs
+++ b/compiler/GHC/Hs/Expr.hs
@@ -36,7 +36,7 @@ import GHC.Hs.Types
import GHC.Hs.Binds
-- others:
-import TcEvidence
+import GHC.Tc.Types.Evidence
import GHC.Core
import GHC.Types.Name
import GHC.Types.Name.Set
@@ -48,8 +48,8 @@ import Outputable
import FastString
import GHC.Core.Type
import TysWiredIn (mkTupleStr)
-import TcType (TcType)
-import {-# SOURCE #-} TcRnTypes (TcLclEnv)
+import GHC.Tc.Utils.TcType (TcType)
+import {-# SOURCE #-} GHC.Tc.Types (TcLclEnv)
-- libraries:
import Data.Data hiding (Fixity(..))
@@ -836,7 +836,7 @@ A tuple data constructor like () or (,,,) is parsed as an `HsVar`, not an
Note that the tuple section has *inferred* arguments, while the data
constructor has *specified* ones.
- (See Note [Required, Specified, and Inferred for types] in TcTyClsDecls
+ (See Note [Required, Specified, and Inferred for types] in GHC.Tc.TyCl
for background.)
Sadly, the grammar for this is actually ambiguous, and it's only thanks to the
@@ -2376,7 +2376,7 @@ data HsSplice id
(IdP id) -- A unique name to identify this splice point
(LHsExpr id) -- See Note [Pending Splices]
- | HsQuasiQuote -- See Note [Quasi-quote overview] in TcSplice
+ | HsQuasiQuote -- See Note [Quasi-quote overview] in GHC.Tc.Gen.Splice
(XQuasiQuote id)
(IdP id) -- Splice point
(IdP id) -- Quoter
@@ -2435,7 +2435,7 @@ instance Data ThModFinalizers where
dataTypeOf a = mkDataType "HsExpr.ThModFinalizers" [toConstr a]
-- See Note [Running typed splices in the zonker]
--- These are the arguments that are passed to `TcSplice.runTopSplice`
+-- These are the arguments that are passed to `GHC.Tc.Gen.Splice.runTopSplice`
data DelayedSplice =
DelayedSplice
TcLclEnv -- The local environment to run the splice in
diff --git a/compiler/GHC/Hs/Lit.hs b/compiler/GHC/Hs/Lit.hs
index a0e95c973d..629ff6e32b 100644
--- a/compiler/GHC/Hs/Lit.hs
+++ b/compiler/GHC/Hs/Lit.hs
@@ -57,7 +57,7 @@ data HsLit x
-- ^ Packed bytes
| HsInt (XHsInt x) IntegralLit
-- ^ Genuinely an Int; arises from
- -- @TcGenDeriv@, and from TRANSLATION
+ -- @GHC.Tc.Deriv.Generate@, and from TRANSLATION
| HsIntPrim (XHsIntPrim x) {- SourceText -} Integer
-- ^ literal @Int#@
| HsWordPrim (XHsWordPrim x) {- SourceText -} Integer
diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs
index a93ad5d06a..fe5bbe65b6 100644
--- a/compiler/GHC/Hs/Pat.hs
+++ b/compiler/GHC/Hs/Pat.hs
@@ -55,7 +55,7 @@ import GHC.Hs.Binds
import GHC.Hs.Lit
import GHC.Hs.Extension
import GHC.Hs.Types
-import TcEvidence
+import GHC.Tc.Types.Evidence
import GHC.Types.Basic
-- others:
import GHC.Core.Ppr ( {- instance OutputableBndr TyVar -} )
@@ -243,7 +243,7 @@ data Pat p
| NPlusKPat (XNPlusKPat p) -- Type of overall pattern
(Located (IdP p)) -- n+k pattern
(Located (HsOverLit p)) -- It'll always be an HsIntegral
- (HsOverLit p) -- See Note [NPlusK patterns] in TcPat
+ (HsOverLit p) -- See Note [NPlusK patterns] in GHC.Tc.Gen.Pat
-- NB: This could be (PostTc ...), but that induced a
-- a new hs-boot file. Not worth it.
@@ -449,7 +449,7 @@ data HsRecField' id arg = HsRecField {
--
-- hsRecFieldLbl = Unambiguous "x" $sel:x:MkS :: AmbiguousFieldOcc Id
--
--- See also Note [Disambiguating record fields] in TcExpr.
+-- See also Note [Disambiguating record fields] in GHC.Tc.Gen.Expr.
hsRecFields :: HsRecFields p arg -> [XCFieldOcc p]
hsRecFields rbinds = map (unLoc . hsRecFieldSel . unLoc) (rec_flds rbinds)
@@ -556,7 +556,7 @@ pprPat (ConPatOut { pat_con = con
, pat_args = details })
= sdocOption sdocPrintTypecheckerElaboration $ \case
False -> pprUserCon (unLoc con) details
- True -> -- Tiresome; in TcBinds.tcRhs we print out a
+ True -> -- Tiresome; in GHC.Tc.Gen.Bind.tcRhs we print out a
-- typechecked Pat in an error message,
-- and we want to make sure it prints nicely
ppr con
diff --git a/compiler/GHC/Hs/Types.hs b/compiler/GHC/Hs/Types.hs
index 21f9f38abf..6b2bd2dea2 100644
--- a/compiler/GHC/Hs/Types.hs
+++ b/compiler/GHC/Hs/Types.hs
@@ -143,7 +143,7 @@ Then we use a LHsBndrSig on the binder, so that the
renamer can decorate it with the variables bound
by the pattern ('a' in the first example, 'k' in the second),
assuming that neither of them is in scope already
-See also Note [Kind and type-variable binders] in GHC.Rename.Types
+See also Note [Kind and type-variable binders] in GHC.Rename.HsType
Note [HsType binders]
~~~~~~~~~~~~~~~~~~~~~
@@ -231,7 +231,7 @@ Note carefully:
determine whether or not to emit hole constraints on each wildcard
(we don't if it's a visible type/kind argument or a type family pattern).
See related notes Note [Wildcards in visible kind application]
- and Note [Wildcards in visible type application] in TcHsType.hs
+ and Note [Wildcards in visible type application] in GHC.Tc.Gen.HsType
* After type checking is done, we report what types the wildcards
got unified with.
@@ -264,7 +264,7 @@ By "stable", we mean that any two variables who do not depend on each other
preserve their existing left-to-right ordering.
Implicitly bound variables are collected by the extract- family of functions
-(extractHsTysRdrTyVars, extractHsTyVarBndrsKVs, etc.) in GHC.Rename.Types.
+(extractHsTysRdrTyVars, extractHsTyVarBndrsKVs, etc.) in GHC.Rename.HsType.
These functions thus promise to keep left-to-right ordering.
Look for pointers to this note to see the places where the action happens.
@@ -366,7 +366,7 @@ data HsImplicitBndrs pass thing -- See Note [HsType binders]
-- Implicitly-bound kind & type vars
-- Order is important; see
-- Note [Ordering of implicit variables]
- -- in GHC.Rename.Types
+ -- in GHC.Rename.HsType
, hsib_body :: thing -- Main payload (type or list of types)
}
@@ -601,7 +601,7 @@ data HsType pass
| HsParTy (XParTy pass)
(LHsType pass) -- See Note [Parens in HsSyn] in GHC.Hs.Expr
-- Parenthesis preserved for the precedence re-arrangement in
- -- GHC.Rename.Types
+ -- GHC.Rename.HsType
-- It's important that a * (b + c) doesn't get rearranged to (a*b) + c!
-- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'('@,
-- 'ApiAnnotation.AnnClose' @')'@
@@ -1013,7 +1013,7 @@ terms, such as this example:
If we do not pattern-match on ForallInvis in hsScopedTvs, then `a` would
erroneously be brought into scope over the body of `x` when renaming it.
-Although the typechecker would later reject this (see `TcValidity.vdqAllowed`),
+Although the typechecker would later reject this (see `GHC.Tc.Validity.vdqAllowed`),
it is still possible for this to wreak havoc in the renamer before it gets to
that point (see #17687 for an example of this).
Bottom line: nip problems in the bud by matching on ForallInvis from the start.
@@ -1345,7 +1345,7 @@ mkFieldOcc rdr = FieldOcc noExtField rdr
-- occurrences).
--
-- See Note [HsRecField and HsRecUpdField] in GHC.Hs.Pat and
--- Note [Disambiguating record fields] in TcExpr.
+-- Note [Disambiguating record fields] in GHC.Tc.Gen.Expr.
-- See Note [Located RdrNames] in GHC.Hs.Expr
data AmbiguousFieldOcc pass
= Unambiguous (XUnambiguous pass) (Located RdrName)
diff --git a/compiler/GHC/Hs/Utils.hs b/compiler/GHC/Hs/Utils.hs
index 99763d25a3..7c59c8abdb 100644
--- a/compiler/GHC/Hs/Utils.hs
+++ b/compiler/GHC/Hs/Utils.hs
@@ -10,8 +10,8 @@ which deal with the instantiated versions are located elsewhere:
Parameterised by Module
---------------- -------------
GhcPs/RdrName parser/RdrHsSyn
- GhcRn/Name rename/RnHsSyn
- GhcTc/Id typecheck/TcHsSyn
+ GhcRn/Name GHC.Rename.*
+ GhcTc/Id GHC.Tc.Utils.Zonk
The @mk*@ functions attempt to construct a not-completely-useless SrcSpan
from their components, compared with the @nl*@ functions which
@@ -109,13 +109,13 @@ import GHC.Hs.Types
import GHC.Hs.Lit
import GHC.Hs.Extension
-import TcEvidence
+import GHC.Tc.Types.Evidence
import GHC.Types.Name.Reader
import GHC.Types.Var
import GHC.Core.TyCo.Rep
import GHC.Core.Type ( appTyArgFlags, splitAppTys, tyConArgFlags, tyConAppNeedsKindSig )
import TysWiredIn ( unitTy )
-import TcType
+import GHC.Tc.Utils.TcType
import GHC.Core.DataCon
import GHC.Core.ConLike
import GHC.Types.Id
@@ -1023,7 +1023,7 @@ collect_bind _ (VarBind { var_id = f }) acc = f : acc
collect_bind _ (AbsBinds { abs_exports = dbinds }) acc = map abe_poly dbinds ++ acc
-- I don't think we want the binders from the abe_binds
- -- binding (hence see AbsBinds) is in zonking in TcHsSyn
+ -- binding (hence see AbsBinds) is in zonking in GHC.Tc.Utils.Zonk
collect_bind omitPatSyn (PatSynBind _ (PSB { psb_id = L _ ps })) acc
| omitPatSyn = acc
| otherwise = ps : acc