Commit 4ca21027 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #3845

parent 1df10fbd
{-# LANGUAGE TemplateHaskell #-}
module THBug1 where
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
data HCons a b = HCons a b
data HNil = HNil
mhlt :: [Q Type] -> Q Type
mhlt xss = [t| $(foldThing xss)|]
where
foldThing (x:xs) = [t| HCons $x $(foldThing xs)|]
foldThing [] = [t| HNil |]
mhlt1 :: [Int] -> Q Exp
mhlt1 xss = [| $(foldThing1 xss) |]
where
foldThing1 (x:xs) = [| x : $(foldThing1 xs)|]
foldThing1 [] = [| [] |]
......@@ -158,3 +158,4 @@ test('T3100', normal, compile, ['-v0'])
test('T3600', extra_clean(['T3600a.hi','T3600a.o']),
multimod_compile, ['T3600','-v0'])
test('T3845', normal, compile, ['-v0'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment