Commit 68450d54 authored by igloo's avatar igloo

[project @ 2003-06-08 18:12:27 by igloo]

Introduce a ListP for consistency with ListE. Splicing in something with
a list pattern now works too.

Added various list tests.
parent c874a01a
-- test the representation of literals and also explicit type annotations
module TH_repE1
where
import Language.Haskell.THSyntax
emptyListExpr :: ExpQ
emptyListExpr = [| [] |]
singletonListExpr :: ExpQ
singletonListExpr = [| [4] |]
listExpr :: ExpQ
listExpr = [| [4,5,6] |]
consExpr :: ExpQ
consExpr = [| 4:5:6:[] |]
-- test the representation of literals and also explicit type annotations
module TH_repE1
where
import Language.Haskell.THSyntax
$( do let emptyListExpr :: ExpQ
emptyListExpr = [| [] |]
singletonListExpr :: ExpQ
singletonListExpr = [| [4] |]
listExpr :: ExpQ
listExpr = [| [4,5,6] |]
consExpr :: ExpQ
consExpr = [| 4:5:6:[] |]
[d| foo = ($emptyListExpr, $singletonListExpr, $listExpr, $consExpr) |]
)
bar = $( [| case undefined of
[1] -> 1 |] )
......@@ -6,6 +6,8 @@ setTestOpts(only_ways(['normal']));
test('TH_repE1', normal, compile, [''])
test('TH_repE2', normal, compile_and_run, [''])
test('TH_repE3', normal, compile, [''])
test('TH_spliceE3', normal, compile, [''])
test('TH_repPrim', normal, compile, [''])
test('TH_repPrimOutput', normal, compile_and_run, [''])
......
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