[GHC] #14343: bad pretty-printing of types with promoted data types

GHC ghc-devs at haskell.org
Sat May 26 16:49:02 UTC 2018


#14343: bad pretty-printing of types with promoted data types
-------------------------------------+-------------------------------------
        Reporter:  lspitzner         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * keywords:   => newcomer


Comment:

 This is just a deficiency of GHC's pretty-printer. It should be relatively
 straightforward to change it such that GHC inserts a space between `'[`
 and `'True`. See the
 [http://git.haskell.org/ghc.git/blob/6a9b9b431dcc94849d14c13639eb2f713e5aa1f4:/compiler/iface/IfaceType.hs#l937
 pprIfaceTyList] function, which is responsible for pretty-printing
 promoted lists.

 Note that similar considerations also apply for promoted tuple
 constructors:

 {{{
 λ> f :: Proxy _ -> Proxy '( 'True, 'True); f x = x

 <interactive>:5:12: error:
     • Found type wildcard ‘_’
         standing for ‘'('True, 'True) :: (Bool, Bool)’
       To use the inferred type, enable PartialTypeSignatures
     • In the type signature: f :: Proxy _ -> Proxy '( 'True,  'True)
 }}}

 So an analogous fix would be needed for the
 [http://git.haskell.org/ghc.git/blob/6a9b9b431dcc94849d14c13639eb2f713e5aa1f4:/compiler/iface/IfaceType.hs#l1131
 pprTuple] function.

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


More information about the ghc-tickets mailing list