[GHC] #11679: Quasi-quoting syntax is ambiguous with list comprehensions

#11679: Quasi-quoting syntax is ambiguous with list comprehensions -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- There is an unfortunate ambiguity between list comprehension syntax and quasi-quotation. Consider the following with and without `-XQuasiQuotes` (noted [[https://github.com/haskell/haskell- mode/issues/1185#issuecomment-192624592|here]], {{{#!hs let x = [ v | v <- [1,2,3]] let x = [v| v <- [1,2,3]] }}} While the former is always a list comprehension, the latter is a quasi- quote when `-XQuasiQuotes` is enabled. The original quasi-quoting syntax required a dollar sign before the quoter, although this was dropped in 26f164e5759e9eca73deb0531ddec422d36a6924. 9ba922ee06b048774d7a82964867ff768a78126e suggests that the old dollar sign syntax is slated for eventual removal. Unfortunately, given it has been five years since the requirement for a dollar sign was dropped I suspect it's a bit late to revert to the previous syntax. This ticket is simply meant to document the fact that this ambiguity exists. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11679 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11679: Quasi-quoting syntax is ambiguous with list comprehensions -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | 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 goldfire): Instead of putting this in a ticket when there is no plan to fix the problem, shouldn't this just be added to the infelicities/stolen syntax part of the manual? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11679#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11679: Quasi-quoting syntax is ambiguous with list comprehensions -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1981 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D1981 Comment: I've opened Phab:D1981 documenting this issue in the users guide. I'm not pleased with this situation, but I don't see any good fix at this point. Consequently I'll close this ticket as wontfix once the documentation is merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11679#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11679: Quasi-quoting syntax is ambiguous with list comprehensions -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1981 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Here's an example (due to hvr) which will compile with and without `-XQuasiQuotes` but will produce different results, {{{#!hs import Text.Heredoc (here) x :: String x = [here| here <- ['h','e','r','e']] -- |] }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11679#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11679: Quasi-quoting syntax is ambiguous with list comprehensions -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1981 Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): [http://mashable.com/wp-content/uploads/2013/07/crying-waterfalls.gif :(] -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11679#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11679: Quasi-quoting syntax is ambiguous with list comprehensions
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 7.10.3
(Parser) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1981
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11679: Quasi-quoting syntax is ambiguous with list comprehensions -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: closed Priority: low | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1981 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.0.1 Comment: Merged as 57cfb4740424f4ab49f772a241fc38bf18d9d19c. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11679#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC