diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-05-03 12:59:18 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-05 09:05:43 -0400 |
commit | b528f0f6803054aaa272f5f289c533d4a0593854 (patch) | |
tree | 7d6e5d65d00b7b78ba542c29ff91f6d56b37d7d8 /compiler/GHC | |
parent | 27f9aab340ab9be8c2018e8f3c71c9c18337428b (diff) | |
download | haskell-b528f0f6803054aaa272f5f289c533d4a0593854.tar.gz |
Fix several note references, part 2
Diffstat (limited to 'compiler/GHC')
25 files changed, 38 insertions, 46 deletions
diff --git a/compiler/GHC/Core/InstEnv.hs b/compiler/GHC/Core/InstEnv.hs index 63dde6f6b5..45ecd4f2b5 100644 --- a/compiler/GHC/Core/InstEnv.hs +++ b/compiler/GHC/Core/InstEnv.hs @@ -965,7 +965,7 @@ lookupInstEnv check_overlap_safe (m:_) | isIncoherent (fst m) -> NoUnifiers _ -> all_unifs - -- NOTE [Safe Haskell isSafeOverlap] + -- Note [Safe Haskell isSafeOverlap] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- We restrict code compiled in 'Safe' mode from overriding code -- compiled in any other mode. The rationale is that code compiled diff --git a/compiler/GHC/Core/RoughMap.hs b/compiler/GHC/Core/RoughMap.hs index cc64e96149..30145ee544 100644 --- a/compiler/GHC/Core/RoughMap.hs +++ b/compiler/GHC/Core/RoughMap.hs @@ -180,7 +180,7 @@ Where mightMatch is defined like this: mightMatch [] [] = True -- A perfectly sized match might match mightMatch key [] = True -- A shorter lookup key matches everything mightMatch [] (_:_) = True -- If the lookup key is longer, then still might match - -- Note [RoughMatch and beta reduction] + -- Note [RoughMap and beta reduction] mightMatch (k:ks) (lk:lks) = = case (k,lk) of -- Standard case, matching on a specific known TyCon. diff --git a/compiler/GHC/HsToCore/Binds.hs b/compiler/GHC/HsToCore/Binds.hs index 9da2ecbc02..fe7747a4a1 100644 --- a/compiler/GHC/HsToCore/Binds.hs +++ b/compiler/GHC/HsToCore/Binds.hs @@ -847,7 +847,7 @@ decomposeRuleLhs :: DynFlags -> [Var] -> CoreExpr -> Either DsMessage ([Var], Id, [CoreExpr]) -- (decomposeRuleLhs bndrs lhs) takes apart the LHS of a RULE, -- The 'bndrs' are the quantified binders of the rules, but decomposeRuleLhs --- may add some extra dictionary binders (see Note [Free dictionaries]) +-- may add some extra dictionary binders (see Note [Free dictionaries on rule LHS]) -- -- Returns an error message if the LHS isn't of the expected shape -- Note [Decomposing the left-hand side of a RULE] @@ -881,8 +881,8 @@ decomposeRuleLhs dflags orig_bndrs orig_lhs orig_bndr_set = mkVarSet orig_bndrs - -- Add extra tyvar binders: Note [Free tyvars in rule LHS] - -- and extra dict binders: Note [Free dictionaries in rule LHS] + -- Add extra tyvar binders: Note [Free tyvars on rule LHS] + -- and extra dict binders: Note [Free dictionaries on rule LHS] mk_extra_bndrs fn_id args = scopedSort unbound_tvs ++ unbound_dicts where @@ -940,7 +940,7 @@ Note [Decomposing the left-hand side of a RULE] There are several things going on here. * drop_dicts: see Note [Drop dictionary bindings on rule LHS] * simpleOptExpr: see Note [Simplify rule LHS] -* extra_dict_bndrs: see Note [Free dictionaries] +* extra_dict_bndrs: see Note [Free dictionaries on rule LHS] Note [Free tyvars on rule LHS] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -997,7 +997,7 @@ drop_dicts drops dictionary bindings on the LHS where possible. --> f d Reasoning here is that there is only one d:Eq [Int], and so we can quantify over it. That makes 'd' free in the LHS, but that is later - picked up by extra_dict_bndrs (Note [Dead spec binders]). + picked up by extra_dict_bndrs (see Note [Unused spec binders]). NB 1: We can only drop the binding if the RHS doesn't bind one of the orig_bndrs, which we assume occur on RHS. diff --git a/compiler/GHC/HsToCore/Docs.hs b/compiler/GHC/HsToCore/Docs.hs index c4839ae449..7bf49a6c8d 100644 --- a/compiler/GHC/HsToCore/Docs.hs +++ b/compiler/GHC/HsToCore/Docs.hs @@ -273,8 +273,8 @@ mkMaps env instances decls = names _ decl = getMainDeclBinder env decl {- -Note [1]: ---------- +Note [1] +~~~~~~~~ We relate ClsInsts to InstDecls and DerivDecls using the SrcSpans buried inside them. That should work for normal user-written instances (from looking at GHC sources). We can assume that commented instances are diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs index b962b9bd39..be165c80dd 100644 --- a/compiler/GHC/HsToCore/Utils.hs +++ b/compiler/GHC/HsToCore/Utils.hs @@ -933,8 +933,8 @@ Note [Failure thunks and CPR] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (This note predates join points as formal entities (hence the quotation marks). We can't use actual join points here (see above); if we did, this would also -solve the CPR problem, since join points don't get CPR'd. See Note [Don't CPR -join points] in GHC.Core.Opt.WorkWrap.) +solve the CPR problem, since join points don't get CPR'd. See Note [Don't w/w +join points for CPR] in GHC.Core.Opt.WorkWrap.) When we make a failure point we ensure that it does not look like a thunk. Example: diff --git a/compiler/GHC/Rename/Splice.hs b/compiler/GHC/Rename/Splice.hs index e9eb2c78bb..e67e480d78 100644 --- a/compiler/GHC/Rename/Splice.hs +++ b/compiler/GHC/Rename/Splice.hs @@ -475,7 +475,7 @@ rnSpliceExpr splice run_expr_splice :: HsSplice GhcRn -> RnM (HsExpr GhcRn, FreeVars) run_expr_splice rn_splice | isTypedSplice rn_splice -- Run it later, in the type checker - = do { -- Ugh! See Note [Splices] above + = do { -- Ugh! See Note [Free variables of typed splices] above traceRn "rnSpliceExpr: typed expression splice" empty ; lcl_rdr <- getLocalRdrEnv ; gbl_rdr <- getGlobalRdrEnv diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index bf6227737f..e4f4de3fc5 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -985,7 +985,7 @@ typeKind normalise str = withSession $ \hsc_env -> {- Note [Querying instances for a type] - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the implementation of GHC proposal 41. (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0041-ghci-instances.rst) diff --git a/compiler/GHC/Runtime/Interpreter.hs b/compiler/GHC/Runtime/Interpreter.hs index ed906279cc..a61578278f 100644 --- a/compiler/GHC/Runtime/Interpreter.hs +++ b/compiler/GHC/Runtime/Interpreter.hs @@ -200,7 +200,7 @@ interpCmd interp msg = case interpInstance interp of InternalInterp -> run msg -- Just run it directly #endif ExternalInterp c i -> withIServ_ c i $ \iserv -> - uninterruptibleMask_ $ -- Note [uninterruptibleMask_] + uninterruptibleMask_ $ -- Note [uninterruptibleMask_ and interpCmd] iservCall iserv msg diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index 8c46285ad4..237c6fa4a3 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -175,7 +175,7 @@ reportUnsolved wanted -- NB: Type-level holes are OK, because there are no bindings. -- See Note [Deferring coercion errors to runtime] -- Used by solveEqualities for kind equalities --- (see Note [Fail fast on kind errors] in "GHC.Tc.Solver") +-- (see Note [Failure in local type signatures] in GHC.Tc.Solver) reportAllUnsolved :: WantedConstraints -> TcM () reportAllUnsolved wanted = do { ev_binds <- newNoTcEvBinds @@ -2237,7 +2237,7 @@ something like Discussion in #9611. Note [Highlighting ambiguous type variables] -~------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we encounter ambiguous type variables (i.e. type variables that remain metavariables after type inference), we need a few more conditions before we can reason that *ambiguity* prevents constraints diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs index e8cf8ce097..59bde4f0aa 100644 --- a/compiler/GHC/Tc/Errors/Ppr.hs +++ b/compiler/GHC/Tc/Errors/Ppr.hs @@ -2234,7 +2234,7 @@ pprTcSolverReportMsg ctxt@(CEC {cec_encl = implics}) orig = errorItemOrigin item pred = errorItemPred item (clas, tys) = getClassPredTys pred - -- See Note [Highlighting ambiguous type variables] + -- See Note [Highlighting ambiguous type variables] in GHC.Tc.Errors (ambig_kvs, ambig_tvs) = ambigTkvsOfTy pred ambigs = ambig_kvs ++ ambig_tvs has_ambigs = not (null ambigs) diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index b86f1d1506..b1f635325a 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -2976,8 +2976,7 @@ data PromotionErr -- in GHC.Tc.Utils.Env. | ConstrainedDataConPE PredType -- Data constructor with a non-equality context - -- See Note [Don't promote data constructors with - -- non-equality contexts] in GHC.Tc.Gen.HsType + -- See Note [Constraints in kinds] in GHC.Core.TyCo.Rep | PatSynPE -- Pattern synonyms -- See Note [Don't promote pattern synonyms] in GHC.Tc.Utils.Env diff --git a/compiler/GHC/Tc/Gen/Arrow.hs b/compiler/GHC/Tc/Gen/Arrow.hs index b404a00b1a..a4eff74ea4 100644 --- a/compiler/GHC/Tc/Gen/Arrow.hs +++ b/compiler/GHC/Tc/Gen/Arrow.hs @@ -435,7 +435,7 @@ tcArrDoStmt env ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_n -- NB: The rec_ids for the recursive things -- already scope over this part. This binding may shadow -- some of them with polymorphic things with the same Name - -- (see Note [RecStmt] in GHC.Hs.Expr) + -- (see Note [How RecStmt works] in Language.Haskell.Syntax.Expr) ; let rec_ids = takeList rec_names tup_ids ; later_ids <- tcLookupLocalIds later_names diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs index 53e880c0f6..31f47227c8 100644 --- a/compiler/GHC/Tc/Gen/Foreign.hs +++ b/compiler/GHC/Tc/Gen/Foreign.hs @@ -146,7 +146,7 @@ normaliseFfiType' env ty0 = runWriterT $ go Representational initRecTc ty0 | isNewTyCon tc -- Expand newtypes , Just rec_nts' <- checkRecTc rec_nts tc - -- See Note [Expanding newtypes] in GHC.Core.TyCon + -- See Note [Expanding newtypes and products] in GHC.Core.TyCon.RecWalk -- We can't just use isRecursiveTyCon; sometimes recursion is ok: -- newtype T = T (Ptr T) -- Here, we don't reject the type for being recursive. diff --git a/compiler/GHC/Tc/Gen/Match.hs b/compiler/GHC/Tc/Gen/Match.hs index 05d95bf6d2..9c838785ac 100644 --- a/compiler/GHC/Tc/Gen/Match.hs +++ b/compiler/GHC/Tc/Gen/Match.hs @@ -546,7 +546,7 @@ tcLcStmt m_tc ctxt (TransStmt { trS_form = form, trS_stmts = stmts -- Ensure that every old binder of type `b` is linked up with its -- new binder which should have type `n b` - -- See Note [GroupStmt binder map] in GHC.Hs.Expr + -- See Note [TransStmt binder map] in GHC.Hs.Expr n_bndr_ids = zipWith mk_n_bndr n_bndr_names bndr_ids bindersMap' = bndr_ids `zip` n_bndr_ids @@ -739,7 +739,7 @@ tcMcStmt ctxt (TransStmt { trS_stmts = stmts, trS_bndrs = bindersMap -- Ensure that every old binder of type `b` is linked up with its -- new binder which should have type `n b` - -- See Note [GroupStmt binder map] in GHC.Hs.Expr + -- See Note [TransStmt binder map] in GHC.Hs.Expr n_bndr_ids = zipWithEqual "tcMcStmt" mk_n_bndr n_bndr_names bndr_ids bindersMap' = bndr_ids `zip` n_bndr_ids @@ -1005,7 +1005,7 @@ Otherwise the error shows up when checking the rebindable syntax, and the expected/inferred stuff is back to front (see #3613). Note [typechecking ApplicativeStmt] - +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ join ((\pat1 ... patn -> body) <$> e1 <*> ... <*> en) fresh type variables: diff --git a/compiler/GHC/Tc/Gen/Pat.hs b/compiler/GHC/Tc/Gen/Pat.hs index 487b1512ab..45cedcbc8d 100644 --- a/compiler/GHC/Tc/Gen/Pat.hs +++ b/compiler/GHC/Tc/Gen/Pat.hs @@ -1402,12 +1402,8 @@ which applies more generally (not just within 'proc'), as it's a good plan in general to bypass the constraint simplification step entirely when it's not needed. -************************************************************************ -* * - Note [Pattern coercions] -* * -************************************************************************ - +Note [Pattern coercions] +~~~~~~~~~~~~~~~~~~~~~~~~ In principle, these program would be reasonable: f :: (forall a. a->a) -> Int diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index 604740c657..52473f3d93 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -624,7 +624,7 @@ Note [Missed opportunity to retain higher-rank kinds] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In 'kcTyClGroup', there is a missed opportunity to make kind inference work in a few more cases. The idea is analogous -to Note [Single function non-recursive binding special-case]: +to Note [Special case for non-recursive function bindings]: * If we have an SCC with a single decl, which is non-recursive, instead of creating a unification variable representing the @@ -1892,8 +1892,7 @@ DT3 Eta-expansion: Any forall-bound variables and function arguments in a result is produced by processing the return kind in etaExpandAlgTyCon, called in tcDataDefn. - See also Note [TyConBinders for the result kind signatures of a data type] - in GHC.Tc.Gen.HsType. + See also Note [splitTyConKind] in GHC.Tc.Gen.HsType. DT4 Datatype return kind restriction: A data type return kind must end in a type that, after type-synonym expansion, yields `TYPE LiftedRep`. By diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs index 24802a65ea..90951272a2 100644 --- a/compiler/GHC/Tc/TyCl/Instance.hs +++ b/compiler/GHC/Tc/TyCl/Instance.hs @@ -944,7 +944,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- clearer to duplicate it. Still, if you fix a bug here, -- check there too! - -- See GHC.Tc.TyCl Note [Generalising in tcFamTyPatsGuts] + -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index f7dd7e7a9a..31e5f8ceed 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -1217,7 +1217,7 @@ ClosedLet means that - The fvs::RhsNames contains the free names of the RHS, excluding Global and ClosedLet ones. - - For the ClosedTypeId field see Note [Bindings with closed types] + - For the ClosedTypeId field see Note [Bindings with closed types: ClosedTypeId] For (static e) to be valid, we need for every 'x' free in 'e', that x's binding is floatable to the top level. Specifically: diff --git a/compiler/GHC/Tc/Utils/Env.hs b/compiler/GHC/Tc/Utils/Env.hs index b116cbbb29..01fde4cd1a 100644 --- a/compiler/GHC/Tc/Utils/Env.hs +++ b/compiler/GHC/Tc/Utils/Env.hs @@ -553,7 +553,7 @@ tcExtendNameTyVarEnv binds thing_inside names = [(name, ATyVar name tv) | (name, tv) <- binds] isTypeClosedLetBndr :: Id -> Bool --- See Note [Bindings with closed types] in GHC.Tc.Types +-- See Note [Bindings with closed types: ClosedTypeId] in GHC.Tc.Types isTypeClosedLetBndr = noFreeVarsOfType . idType tcExtendRecIds :: [(Name, TcId)] -> TcM a -> TcM a @@ -1125,7 +1125,7 @@ mkWrapperName :: (MonadIO m, HasModule m) => IORef (ModuleEnv Int) -> String -> String -> m FastString -- ^ @mkWrapperName ref what nameBase@ -- --- See Note [Generating fresh names for ccall wrapper] for @ref@'s purpose. +-- See Note [Generating fresh names for FFI wrappers] for @ref@'s purpose. mkWrapperName wrapperRef what nameBase = do thisMod <- getModule let pkg = unitString (moduleUnit thisMod) @@ -1187,9 +1187,6 @@ notFound name } wrongThingErr :: String -> TcTyThing -> Name -> TcM a --- It's important that this only calls pprTcTyThingCategory, which in --- turn does not look at the details of the TcTyThing. --- See Note [Placeholder PatSyn kinds] in GHC.Tc.Gen.Bind wrongThingErr expected thing name = let msg = TcRnUnknownMessage $ mkPlainError noHints $ (pprTcTyThingCategory thing <+> quotes (ppr name) <+> diff --git a/compiler/GHC/Tc/Utils/TcMType.hs b/compiler/GHC/Tc/Utils/TcMType.hs index 1206b95da7..21954240d6 100644 --- a/compiler/GHC/Tc/Utils/TcMType.hs +++ b/compiler/GHC/Tc/Utils/TcMType.hs @@ -747,7 +747,7 @@ skolems. They are used in two places: 1. In kind signatures, see GHC.Tc.TyCl Note [Inferring kinds for type declarations] - and Note [Kind checking for GADTs] + and Note [Using TyVarTvs for kind-checking GADTs] 2. In partial type signatures. See GHC.Tc.Types Note [Quantified variables in partial type signatures] diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs index 63ba3e01c5..bb9f5aa910 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs +++ b/compiler/GHC/Tc/Utils/TcType.hs @@ -588,7 +588,7 @@ we would need to enforce the separation. -} -- A TyVarDetails is inside a TyVar --- See Note [TyVars and TcTyVars] +-- See Note [TyVars and TcTyVars during type checking] data TcTyVarDetails = SkolemTv -- A skolem SkolemInfo diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs index 931ea20796..a839822e40 100644 --- a/compiler/GHC/ThToHs.hs +++ b/compiler/GHC/ThToHs.hs @@ -1798,8 +1798,9 @@ wrap_tyarg (HsTypeArg l ki) = HsTypeArg l $ parenthesizeHsType appPrec ki wrap_tyarg ta@(HsArgPar {}) = ta -- Already parenthesized -- --------------------------------------------------------------------- --- Note [Adding parens for splices] {- +Note [Adding parens for splices] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The hsSyn representation of parsed source explicitly contains all the original parens, as written in the source. diff --git a/compiler/GHC/Types/Basic.hs b/compiler/GHC/Types/Basic.hs index 92bb8241dd..d562d0937f 100644 --- a/compiler/GHC/Types/Basic.hs +++ b/compiler/GHC/Types/Basic.hs @@ -621,7 +621,7 @@ instance Outputable Origin where -} -- | The semantics allowed for overlapping instances for a particular --- instance. See Note [Safe Haskell isSafeOverlap] (in "GHC.Core.InstEnv") for a +-- instance. See Note [Safe Haskell isSafeOverlap] in GHC.Core.InstEnv for a -- explanation of the `isSafeOverlap` field. -- -- - 'GHC.Parser.Annotation.AnnKeywordId' : diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs index ad890ee31d..54c5ad47ec 100644 --- a/compiler/GHC/Types/Demand.hs +++ b/compiler/GHC/Types/Demand.hs @@ -1362,7 +1362,7 @@ Then argsOneShots returns a [[OneShotInfo]] of [[OneShot,NoOneShotInfo,OneShot], [OneShot]] The occurrence analyser propagates this one-shot infor to the binders \pqr and \xyz; -see Note [Use one-shot information] in "GHC.Core.Opt.OccurAnal". +see Note [Sources of one-shot information] in GHC.Core.Opt.OccurAnal. Note [Boxity in Poly] ~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/GHC/Types/Unique.hs b/compiler/GHC/Types/Unique.hs index 25075f47a1..f4538bf579 100644 --- a/compiler/GHC/Types/Unique.hs +++ b/compiler/GHC/Types/Unique.hs @@ -75,7 +75,7 @@ A `Unique` in GHC is a Word-sized value composed of two pieces: The mask is typically an ASCII character. It is typically used to make it easier to distinguish uniques constructed by different parts of the compiler. There is a (potentially incomplete) list of unique masks used given in -GHC.Builtin.Uniques. See Note [Uniques-prelude - Uniques for wired-in Prelude things] +GHC.Builtin.Uniques. See Note [Uniques for wired-in prelude things and known masks] `mkUnique` constructs a `Unique` from its pieces mkUnique :: Char -> Int -> Unique |