[GHC] #15392: Inconsistency in parsing trailing commas inside import section

#15392: Inconsistency in parsing trailing commas inside import section -------------------------------------+------------------------------------- Reporter: chshersh | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 (Parser) | Keywords: | Operating System: Unknown/Multiple imports,trailing,commas | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following Haskell code compiles without problems: {{{#!hs import Data.Bool (Bool,) }}} As I understand, trailing commas are allowed at the end of `import` declaration. But if I have trailing comma inside data type import part, I see parse error: {{{#!hs import Data.Bool (Bool (True,)) }}} I don't see why this code is forbidden. But allowing trailing commas inside parts of data type imports will make support for automatic refactoring tools easier since they don't need to care about this special case for removing trailing comma manually. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15392 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15392: Inconsistency in parsing trailing commas inside import section -------------------------------------+------------------------------------- Reporter: chshersh | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (Parser) | Keywords: Resolution: | imports,trailing,commas 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 chshersh): bgamari, so this is indeed a bug and it makes sense to fix it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15392#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15392: Inconsistency in parsing trailing commas inside import section -------------------------------------+------------------------------------- Reporter: chshersh | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (Parser) | Keywords: Resolution: | imports,trailing,commas 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 nomeata): Not a bug, unfortunately, but behavious as specified in the report: https://www.haskell.org/onlinereport/haskell2010/haskellch5.html#x11-1000005... There is a language extensions proposal underway that would fix this, but it now does much more stuff: https://github.com/ghc-proposals/ghc-proposals/pull/87 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15392#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC