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

#15843: Tuple sections can't be quoted -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Keywords: newcomer | 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 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 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: newcomer => newcomer, TemplateHaskell -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15843#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Comment (by goldfire): I disagree with the design in the original post. TH syntax should really be as close as possible to Haskell syntax. Instead, I would say that TH should support tuple sections directly. I propose changing `TupE :: [Exp] -> Exp` to become `TupE :: [Maybe Exp] -> Exp`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15843#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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
participants (1)
-
GHC