Skip to content

Tuple sections can't be quoted

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.
Edited by Ömer Sinan Ağacan
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information