id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
3899,-ddump-splices missing parentheses in pattern,guest,igloo,"'''Main.hs'''
{{{
{-# LANGUAGE TemplateHaskell #-}

import Language.Haskell.TH
import Control.Monad

data Cons a b = Cons a b
data Nil = Nil

nestedTuple n = do
    xs <- replicateM n (newName ""x"")
    return $ LamE [foldr (\v prev -> ConP 'Cons [VarP v,prev]) (ConP 'Nil []) xs]
                (TupE $ map VarE xs)
}}}


'''Load Main into ghci:'''
{{{
*Main> :set -XTemplateHaskell
*Main> :set -ddump-splices
*Main> :t $(nestedTuple 3)
<interactive>:1:2:
    <interactive>:1:2-14: Splicing expression
        nestedTuple 3
      ======>
        \ Cons x[aYQ] Cons x[aYR] Cons x[aYS] Nil
            -> (x[aYQ], x[aYR], x[aYS])
    In the expression: $(nestedTuple 3)
$(nestedTuple 3) :: Cons t (Cons t1 (Cons t2 Nil)) -> (t, t1, t2)
}}}

However the inferred type and behavior of the function suggests that the Cons constructors are associated to the right.",merge,closed,normal,,Template Haskell,6.12.1,fixed,,vogt.adam@…,Unknown/Multiple,Unknown/Multiple,None/Unknown,,th/T3899,,,
