blob: 0147d2eca2f7356bb60ba21f4f91841ff9e1aa9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
{-# LANGUAGE ViewPatterns #-}
module A where
import Language.Haskell.TH.Quote
import Language.Haskell.TH
foo :: QuasiQuoter
foo = QuasiQuoter{quotePat = \s -> viewP [|(*2)|] (varP . mkName $ s)}
bar :: QuasiQuoter
bar = QuasiQuoter{quotePat = \_ -> [p|((*3) -> fixed_var)|] }
|