summaryrefslogtreecommitdiff
path: root/testsuite/tests/quasiquotation/qq008/QQ.hs
blob: eee8dc967011c7af7d9be487f5a0792fd119cb39 (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 |] }