[Git][ghc/ghc][master] Remove duplicate Note [When to print foralls] in GHC.Core.TyCo.Ppr
Marge Bot
gitlab at gitlab.haskell.org
Thu May 21 16:10:05 UTC 2020
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
5bcf8606 by Ryan Scott at 2020-05-17T08:46:38-04:00
Remove duplicate Note [When to print foralls] in GHC.Core.TyCo.Ppr
There are two different Notes named `[When to print foralls]`. The
most up-to-date one is in `GHC.Iface.Type`, but there is a second
one in `GHC.Core.TyCo.Ppr`. The latter is less up-to-date, as it was
written before GHC switched over to using ifaces to pretty-print
types. I decided to just remove the latter and replace it with a
reference to the former.
[ci skip]
- - - - -
1 changed file:
- compiler/GHC/Core/TyCo/Ppr.hs
Changes:
=====================================
compiler/GHC/Core/TyCo/Ppr.hs
=====================================
@@ -171,7 +171,8 @@ pprSigmaType = pprIfaceSigmaType ShowForAllWhen . tidyToIfaceType
pprForAll :: [TyCoVarBinder] -> SDoc
pprForAll tvs = pprIfaceForAll (map toIfaceForAllBndr tvs)
--- | Print a user-level forall; see Note [When to print foralls] in this module.
+-- | Print a user-level forall; see @Note [When to print foralls]@ in
+-- "GHC.Iface.Type".
pprUserForAll :: [TyCoVarBinder] -> SDoc
pprUserForAll = pprUserIfaceForAll . map toIfaceForAllBndr
@@ -253,24 +254,6 @@ debug_ppr_ty prec ty@(ForAllTy {})
= ([], ty)
{-
-Note [When to print foralls]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Mostly we want to print top-level foralls when (and only when) the user specifies
--fprint-explicit-foralls. But when kind polymorphism is at work, that suppresses
-too much information; see #9018.
-
-So I'm trying out this rule: print explicit foralls if
- a) User specifies -fprint-explicit-foralls, or
- b) Any of the quantified type variables has a kind
- that mentions a kind variable
-
-This catches common situations, such as a type siguature
- f :: m a
-which means
- f :: forall k. forall (m :: k->*) (a :: k). m a
-We really want to see both the "forall k" and the kind signatures
-on m and a. The latter comes from pprTCvBndr.
-
Note [Infix type variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
With TypeOperators you can say
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5bcf86063c0e5b6ee0d162ea64c88fdaad89e620
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5bcf86063c0e5b6ee0d162ea64c88fdaad89e620
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/20200521/21f05b01/attachment-0001.html>
More information about the ghc-commits
mailing list