[GHC] #15843: Tuple sections can't be quoted

GHC ghc-devs at haskell.org
Thu Dec 13 09:35:41 UTC 2018


#15843: Tuple sections can't be quoted
-------------------------------------+-------------------------------------
        Reporter:  mpickering        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:  newcomer,
                                     |  TemplateHaskell
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by osa1:

Old description:

> There are quite a few forms that are not supported in template haskell
> quotes. It seems that it would be at least a good warm up patch to add
> support for tuple sections which you can do simply by desugaring to a
> lambda and the normal tuple constructor.
>
> {{{
> {-# LANGUAGE TemplateHaskell #-}
> {-# LANGUAGE TupleSections #-}
> module Foo where
>
> foo = [|| (,5) ||]
> }}}
>
> 1. Modify `DsMeta.repE` to handle tuple sections. You can desugar `(,5)
> => `\x -> (x, 5)`.
> 2. Add the above test to the test suite.

New description:

 There are quite a few forms that are not supported in template haskell
 quotes. It seems that it would be at least a good warm up patch to add
 support for tuple sections which you can do simply by desugaring to a
 lambda and the normal tuple constructor.

 {{{
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TupleSections #-}
 module Foo where

 foo = [|| (,5) ||]
 }}}

 1. Modify `DsMeta.repE` to handle tuple sections. You can desugar `(,5) =>
 \x -> (x, 5)`.
 2. Add the above test to the test suite.

--

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15843#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list