[Git][ghc/ghc][wip/T25647] refactor documentation for FamArgFlavour and clean up comments
Patrick (@soulomoon)
gitlab at gitlab.haskell.org
Tue Mar 4 19:42:27 UTC 2025
Patrick pushed to branch wip/T25647 at Glasgow Haskell Compiler / GHC
Commits:
9a1136f5 by Patrick at 2025-03-05T03:42:17+08:00
refactor documentation for FamArgFlavour and clean up comments
- - - - -
3 changed files:
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
Changes:
=====================================
compiler/GHC/Core/TyCon.hs
=====================================
@@ -2980,7 +2980,7 @@ tyConSkolem = isHoleName . tyConName
-{- Note [FamArgFlavour and family instance decl type checking]
+{- Note [FamArgFlavour]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The FamArgFlavour is used to distinguish the different kinds of arguments that may
appear in an associated type family declaration/instance. In an associated type family,
@@ -3022,7 +3022,7 @@ the signature arguments.
For more discussion, see #13908.
-}
--- see Note [FamArgFlavour and family instance decl type checking]
+-- see Note [FamArgFlavour]
data FamArgFlavour = ClassArg | FreeArg | SigArg deriving (Eq, Show)
instance Outputable FamArgFlavour where
=====================================
compiler/GHC/Tc/TyCl.hs
=====================================
@@ -3409,8 +3409,7 @@ without treating the explicitly-quantified ones specially. Wrinkles:
In step 1 we do /not/ want to get
newtype instance forall r . Fix2 (f :: TYPE r -> TYPE r) :: TYPE r where
If we do, we'll get that same "newtype must not be GADT" error as for N above.
- Rather, we want to default the RuntimeRep variable r := LiftedRep. Hence
- the use of `DefaultNonStandardTyVars` in `tcDataFamInstHeader`. The key thing
+ Rather, we want to default the RuntimeRep variable r := LiftedRep. The key thing
is that we must make the /same/ choice here as we do in kind-checking the data
constructor's type.
=====================================
compiler/GHC/Tc/TyCl/Instance.hs
=====================================
@@ -977,7 +977,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity
-- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts]
; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty
; qtvs <- quantifyTyVars skol_info dvs
- -- DefaultNonStandardTyVars: see (GT4) in
+ -- see (GT4) in
-- GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts]
; let final_tvs = scopedSort (qtvs ++ outer_tvs)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9a1136f5e42cd4fa8599551f8c8bdabd7050b4dc
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9a1136f5e42cd4fa8599551f8c8bdabd7050b4dc
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250304/82e7bdd3/attachment-0001.html>
More information about the ghc-commits
mailing list