Add typed holes support in Template Haskell.
[ghc.git] / testsuite / tests / th / T10267.hs
1 {-# LANGUAGE TemplateHaskell #-}
2
3 module T10267 where
4
5 import Language.Haskell.TH
6 import T10267a
7
8 [d| i :: a -> a
9 i = _foo
10
11 j :: a -> a
12 j x = _ |]
13
14 $(return [
15 SigD (mkName "k")
16 (ForallT [PlainTV (mkName "a")]
17 []
18 (AppT (AppT ArrowT (VarT (mkName "a"))) (VarT (mkName "a"))))
19 , FunD (mkName "k")
20 [Clause [] (NormalB (UnboundVarE (mkName "_foo"))) []]
21 ])
22
23 $(return [
24 SigD (mkName "l")
25 (ForallT [PlainTV (mkName "a")]
26 []
27 (AppT (AppT ArrowT (VarT (mkName "a"))) (VarT (mkName "a"))))
28 , FunD (mkName "l")
29 [Clause [VarP (mkName "x")] (NormalB (UnboundVarE (mkName "_"))) []]
30 ])
31
32 foo :: a -> a
33 foo x = $varX