diff options
author | Edsko de Vries <edsko@well-typed.com> | 2013-09-02 08:50:42 +0100 |
---|---|---|
committer | Edsko de Vries <edsko@well-typed.com> | 2013-09-03 12:51:00 +0100 |
commit | 2065c01bf5a3d422ac466055048fd92158a058e6 (patch) | |
tree | 1fc3bf4ddc839780e4f37a4af773b5b6891be6d6 /testsuite/tests/quasiquotation/T7918A.hs | |
parent | 23fb31b6f48eafdbcb10055e5680f13983735c49 (diff) | |
download | haskell-2065c01bf5a3d422ac466055048fd92158a058e6.tar.gz |
Test for T7918
Diffstat (limited to 'testsuite/tests/quasiquotation/T7918A.hs')
-rw-r--r-- | testsuite/tests/quasiquotation/T7918A.hs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/quasiquotation/T7918A.hs b/testsuite/tests/quasiquotation/T7918A.hs new file mode 100644 index 0000000000..f20dfeef59 --- /dev/null +++ b/testsuite/tests/quasiquotation/T7918A.hs @@ -0,0 +1,26 @@ +{-# LANGUAGE TemplateHaskell #-} +module T7918A where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote + +qq = QuasiQuoter { + quoteExp = \str -> case str of + "e1" -> [| True |] + "e2" -> [| id True |] + "e3" -> [| True || False |] + "e4" -> [| False |] + , quoteType = \str -> case str of + "t1" -> [t| Bool |] + "t2" -> [t| Maybe Bool |] + "t3" -> [t| Either Bool Int |] + "t4" -> [t| Int |] + , quotePat = let x = VarP (mkName "x") + y = VarP (mkName "y") + in \str -> case str of + "p1" -> return $ x + "p2" -> return $ ConP 'Just [x] + "p3" -> return $ TupP [x, y] + "p4" -> return $ y + , quoteDec = undefined + } |