[GHC] #10732: Legal Bang Patterns cannot parse

#10732: Legal Bang Patterns cannot parse -------------------------------------+------------------------------------- Reporter: rem | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 (Parser) | Keywords: Bang | Operating System: Unknown/Multiple Pattern Parser | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- According to the syntax provided by GHC user guide pat ::= !pat Both !!pat and pat : !pat should be accepted, but GHC gives parsing error. For detail see http://stackoverflow.com/questions/31790327/where-can- bangpatterns-appear -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10732 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10732: Legal Bang Patterns cannot parse -------------------------------------+------------------------------------- Reporter: rem | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 (Parser) | Keywords: Bang Resolution: | Pattern Parser Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by rem: Old description:
According to the syntax provided by GHC user guide
pat ::= !pat
Both !!pat and pat : !pat should be accepted, but GHC gives parsing error. For detail see http://stackoverflow.com/questions/31790327/where- can-bangpatterns-appear
New description: According to the syntax provided by GHC user guide pat ::= !pat Both !!pat and pat : !pat should be accepted, but GHC gives parsing error. For detail see http://stackoverflow.com/questions/31790327/where-can- bangpatterns-appear There also lacks a formal documentation regarding where BangPatterns can appear (the User Guide mentions in passing that "a pattern with a bang at the outermost level is not allowed at the top level of a module." Are there other restrictions?) -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10732#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10732: Legal Bang Patterns cannot parse -------------------------------------+------------------------------------- Reporter: rem | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 (Parser) | Keywords: Bang Resolution: | Pattern Parser Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Parsing is always fiddly! I'd welcome someone looking into this. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10732#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10732: Legal Bang Patterns cannot parse -------------------------------------+------------------------------------- Reporter: rem | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 (Parser) | Keywords: Bang Pattern Resolution: | Parser Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #1087, #11189 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * related: => #1087, #11189 Comment: Also reported as #11189. More investigation in #1087 (reported 9 years ago!) and http://hackage.haskell.org/trac/haskell- prime/wiki/ArrayIndexing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10732#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC