Commit a78096d4 authored by chak's avatar chak

[project @ 2002-11-09 08:38:19 by chak]

More tests for reifyDecl

** reifyDecl currently barfs on "type" and "newtype" decls **
parent 5e0b456b
-- test reification of declarations
-- test reification of data declarations
module TH_reifyDecl1
where
import Language.Haskell.THSyntax
-- simple
data T = A | B
decl_T :: Decl
decl_T = reifyDecl T
-- parametric
data R a = C a | D
decl_R :: Decl
decl_R = reifyDecl R
-- recursive
data List a = Nil | Cons a (List a)
decl_List :: Decl
decl_List = reifyDecl List
-- infix operator
data Tree a = Leaf | Tree a :+: Tree a
decl_Tree :: Decl
decl_Tree = reifyDecl Tree
-- test reification of type synonym declarations
module TH_reifyDecl2
where
import Language.Haskell.THSyntax
-- type declaration
type IntList = [Int]
decl_IntList :: Decl
decl_IntList = reifyDecl IntList
-- test reification of newtype declarations
module TH_reifyDecl3
where
import Language.Haskell.THSyntax
-- newtype declaration
newtype Length = Length Int
decl_Length :: Decl
decl_Length = reifyDecl Length
......@@ -7,6 +7,8 @@ setTestOpts(only_ways(['normal']));
test('TH_repE1', normal, compile, [''])
test('TH_reifyDecl1', normal, compile, [''])
test('TH_reifyDecl2', normal, compile, [''])
test('TH_reifyDecl3', normal, compile, [''])
test('TH_reifyType1', normal, compile, [''])
test('TH_reifyType2', normal, compile, [''])
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