[GHC] #2530: deriving Show adds extra parens for constructor with record syntax

GHC ghc-devs at haskell.org
Wed Mar 9 16:20:01 UTC 2016


#2530: deriving Show adds extra parens for constructor with record syntax
-------------------------------------+-------------------------------------
        Reporter:  spl               |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  6.8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D669
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 I don't have particularly strong feelings on this matter, and I'd be okay
 with reverting this for now, since multiple GHC devs have expressed their
 displeasure in this change.

 This change does minimize the number of parentheses outputted in a way
 that agrees with the Haskell Report, but as Edward Kmett notes in a
 [https://mail.haskell.org/pipermail/haskell-cafe/2009-November/069497.html
 Haskell Café thread], we're already not using a minimal amount of
 parentheses as it is due to `Show` not taking fixity into account when
 parenthesizing (e.g., you can omit parentheses when chaining several
 `infixl` constructors). I wouldn't feel terrible about adding extra
 parentheses in this particular case.

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


More information about the ghc-tickets mailing list