[GHC] #3384: Add HsSyn prettyprinter tests

GHC ghc-devs at haskell.org
Wed Nov 16 18:35:35 UTC 2016


#3384: Add HsSyn prettyprinter tests
-------------------------------------+-------------------------------------
        Reporter:  igloo             |                Owner:
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  ⊥
       Component:  Test Suite        |              Version:
      Resolution:                    |             Keywords:
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 alanz):

 Capturing some email on ghc-devs: From @alanz

 I am currently working on #3384, with the intent of ensuring that

     parse (ppr (parse source)) == parse source

 I have hit the issue where

    `foo :: (Int)`

 has the parens reflected in the original parsed AST, but the types pretty
 printer goes to a lot of trouble to remove any parens not required to
 interpret the meaning of the type.

 So the question is, should the default ppr faithfully reproduce the source
 that was parsed to generate the given AST, or simplify it?

 From a round-tripping perspective I prefer the former, but there are other
 use cases where the current behaviour is preferred.

 If the original is preferred, it can perhaps be enabled via a flag to the
 pretty printer, but before doing that I want to see if it actually
 matters.

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


More information about the ghc-tickets mailing list