[GHC] #13699: Pretty printing: Strict record fields are not parenthesized properly
#13699: Pretty printing: Strict record fields are not parenthesized properly -------------------------------------+------------------------------------- Reporter: zyla | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: GHCi | Version: 8.0.1 Keywords: pretty-print | Operating System: Unknown/Multiple bang record | Architecture: | Type of failure: Other Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When I type in GHCi: {{{ λ> data Foo = Foo { x :: !(Maybe Int) } λ> :i Foo data Foo = Foo {x :: !Maybe Int} -- Defined at <interactive>:71:1 }}} But this is not legal Haskell syntax: {{{ λ> data Foo = Foo {x :: !Maybe Int} <interactive>:73:22: error: • Unexpected strictness annotation: !Maybe • In the type ‘!Maybe Int’ In the definition of data constructor ‘Foo’ In the data declaration for ‘Foo’ }}} I think it should be pretty printed with parens: {{{ λ> :i Foo data Foo = Foo {x :: !(Maybe Int)} -- Defined at <interactive>:71:1 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13699> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13699: Pretty printing: Strict record fields are not parenthesized properly -------------------------------------+------------------------------------- Reporter: zyla | Owner: (none) Type: bug | Status: patch Priority: low | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: pretty-print | bang record Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3587 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D3587 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13699#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13699: Pretty printing: Strict record fields are not parenthesized properly -------------------------------------+------------------------------------- Reporter: zyla | Owner: (none) Type: bug | Status: patch Priority: low | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: pretty-print | bang record Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3587 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"2108460f9211bf5eab98e0f2f3218dcd271eeaad/ghc" 2108460f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2108460f9211bf5eab98e0f2f3218dcd271eeaad" Pretty-print strict record fields from ifaces correctly We need to use parentheses more when pretty-printing types with bang patterns within constructors that use record syntax. Fixes #13699. Test Plan: make test TEST=T13699 Reviewers: austin, bgamari, dfeuer Reviewed By: dfeuer Subscribers: dfeuer, rwbarton, thomie GHC Trac Issues: #13699 Differential Revision: https://phabricator.haskell.org/D3587 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13699#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13699: Pretty printing: Strict record fields are not parenthesized properly -------------------------------------+------------------------------------- Reporter: zyla | Owner: (none) Type: bug | Status: closed Priority: low | Milestone: 8.4.1 Component: GHCi | Version: 8.0.1 Resolution: fixed | Keywords: pretty-print | bang record Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3587 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13699#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC