91d6173b916851ea3d7996894b44dab17d37f45b
[ghc.git] / testsuite / tests / th / TH_NestedSplices_Lib.hs
1 {-# LANGUAGE TemplateHaskell #-}
2 module TH_NestedSplices_Lib where
3
4 import Language.Haskell.TH
5
6 spliceExpr :: String -> Q Exp -> Q Exp
7 spliceExpr s e = [| (s, $e) |]
8
9 declareFun :: String -> Q [Dec]
10 declareFun s
11 = do { n <- newName s
12 ; d <- funD n [clause [] (normalB [| 22 |]) []]
13 ; return [d] }
14