[GHC] #10747: Infix pattern synonyms fail to parse (regression)

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE PatternSynonyms #-} pattern head `Cons` tail = head : tail }}} In v7.11 I get: {{{ [1 of 1] Compiling Main ( pat.hs, interpreted ) pat.hs:2:14: parse error on input ?`? }}} In v7.10 I get: {{{ *Main> :set -XPatternSynonyms *Main> let h `Cons` t = "ht" *Main> h 'h' *Main> t "t" }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Are you sure about the version numbers? I see it working in 7.8, but failing in 7.10 and HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by heisenbug): Replying to [comment:1 rwbarton]:
Are you sure about the version numbers? I see it working in 7.8, but failing in 7.10 and HEAD.
Ooops, no. Actually I was using a v7.9-201411xx for the test. Sorry for the wrong interpolation :-( -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * priority: normal => high * version: 7.11 => 7.10.1 Old description:
{{{#!hs {-# LANGUAGE PatternSynonyms #-} pattern head `Cons` tail = head : tail }}}
In v7.11 I get: {{{ [1 of 1] Compiling Main ( pat.hs, interpreted )
pat.hs:2:14: parse error on input ?`?
}}}
In v7.10 I get: {{{ *Main> :set -XPatternSynonyms *Main> let h `Cons` t = "ht" *Main> h 'h' *Main> t "t" }}}
New description: {{{#!hs {-# LANGUAGE PatternSynonyms #-} pattern head `Cons` tail = head : tail }}} In v7.10 I get: {{{ [1 of 1] Compiling Main ( pat.hs, interpreted ) pat.hs:2:14: parse error on input ?`? }}} In v7.8 I get: {{{ [1 of 1] Compiling Main ( ph.hs, interpreted ) Ok, modules loaded: Main. *Main> :set -XPatternSynonyms *Main> let h `Cons` t = "ht" *Main> h 'h' *Main> t "t" }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * cc: cactus, mpickering (added) * keywords: => PatternSynonyms * component: Compiler => Compiler (Parser) * milestone: => 7.10.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression)
-------------------------------------+-------------------------------------
Reporter: heisenbug | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.10.3
Component: Compiler | Version: 7.10.1
(Parser) | Keywords:
Resolution: | PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
-------------------------------------+-------------------------------------
Comment (by heisenbug):
Maybe I have to enable `TypeOperators` too?
''

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): -------------------------------------+------------------------------------- Comment (by mpickering): I'm yet to look at this in detail but I suspect that this was never meant to work. I assumed that infix pattern synonyms definitions were meant to be like infix data constructor definitions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): -------------------------------------+------------------------------------- Comment (by heisenbug): Replying to [comment:6 mpickering]:
I'm yet to look at this in detail but I suspect that this was never meant to work. I assumed that infix pattern synonyms definitions were meant to be like infix data constructor definitions.
Then it should work: {{{ $ ghci GHCi, version 7.11.20150928: http://www.haskell.org/ghc/ :? for help Prelude> data List a = Nil | a `Cons` List a deriving Show Prelude> 4 `Cons` Nil 4 `Cons` Nil }}} This has been working for ages! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: mpickering Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): -------------------------------------+------------------------------------- Changes (by mpickering): * owner: => mpickering Comment: Ok! I will add it to my queue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: mpickering Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1295 -------------------------------------+------------------------------------- Changes (by mpickering): * differential: => Phab:D1295 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression)
-------------------------------------+-------------------------------------
Reporter: heisenbug | Owner: mpickering
Type: bug | Status: new
Priority: high | Milestone: 7.10.3
Component: Compiler | Version: 7.10.1
(Parser) | Keywords:
Resolution: | PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1295
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: mpickering Type: bug | Status: merge Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | patsyn/should_compile/T10747 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1295 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => merge * testcase: => patsyn/should_compile/T10747 Comment: One line fix, should be easy to merge. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10747: Infix pattern synonyms fail to parse (regression) -------------------------------------+------------------------------------- Reporter: heisenbug | Owner: mpickering Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.1 (Parser) | Keywords: Resolution: fixed | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | patsyn/should_compile/T10747 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1295 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10747#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC