[GHC] #15871: Revamp -fprint-explicit-kinds
GHC
ghc-devs at haskell.org
Wed Nov 7 17:28:50 UTC 2018
#15871: Revamp -fprint-explicit-kinds
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: (none)
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.2
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
With the imminent #12045, we will have type application in kinds. This
ticket tracks mirroring this new behavior in the pretty-printer.
To wit, when `-fprint-explicit-kinds` is enabled, we should
1. Print instantiations of specified variables like `@...`.
2. Print instantiations of inferred variables like `@{...}`.
Examples:
{{{#!hs
data Proxy (a :: k) = Proxy
-- Then, `Proxy Int` would be printed as `Proxy @Type Int` with -fprint-
explicit-kinds
data Proxy2 a = Proxy2
-- Then, `Proxy2 Int` would be printed as `Proxy2 @{Type} Int` with
-fprint-explicit-kinds
}}}
In addition, sometimes error messages suggest enabling `-fprint-explicit-
kinds`. Instead of doing this, we should just locally enable the flag. The
existence of the `@` prefixes will alert the reader that these are not
type arguments. (Without the `@` syntax, locally and silently enabling
`-fprint-explicit-kinds` would be very confusing.)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15871>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list