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

GHC ghc-devs at haskell.org
Sat Mar 5 14:22:14 UTC 2016


#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


More information about the ghc-tickets mailing list