blob: 3c13315a312f5afaa3680d1c7c9b8055634f250f (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
{-# LANGUAGE TemplateHaskell #-}
module QQ where
import Language.Haskell.TH.Quote
import Language.Haskell.TH
pq = QuasiQuoter { quoteDec = \_ -> [d| f x = x |],
quoteType = \_ -> [t| Int -> Int |],
quoteExp = \_ -> [| $(varE (mkName "x")) + 1::Int |],
quotePat = \_ -> [p| Just x |] }
|