A.hs 279 Bytes
Newer Older
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)|] }