[GHC] #16203: Unhelpful names for wildcard type variables

GHC ghc-devs at haskell.org
Thu Jan 24 13:26:23 UTC 2019


#16203: Unhelpful names for wildcard type variables
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.3
      Resolution:                    |             Keywords:
                                     |  PartialTypeSignatures
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Due to #16082, we're going to pretty-print certain things less than
 optimally regardless of whether we choose `w` or `_`—it's just a question
 of which pill we find easier to swallow.

 I don't have a strong opinion on the matter, but it is worth noting that
 the choice of `_` actually causes some things to be printed out in a
 manner that's flat-out incorrect. For example, here is the
 [https://gitlab.haskell.org/ghc/ghc/blob/master/testsuite/tests/partial-
 sigs/should_compile/Either.stderr stderr from the Either test]:

 {{{
 TYPE SIGNATURES
   barry :: forall _. _ -> (Either [Char] _, Either [Char] _)
 Dependent modules: []
 Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3,
                      integer-gmp-1.0.2.0]
 }}}

 Notice the use of `forall _` there, which isn't valid GHC code.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16203#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list