The documentation for template Haskell says that QuasiQuoter
is defined as
data QuasiQuoter = QuasiQuoter { quoteExp :: String -> Q Exp,
quotePat :: String -> Q Pat,
quoteType :: String -> Q Type,
quoteDec :: String -> Q [Dec] }
I have encountered examples such as silly
shown below. How do they work given that they don't seem to fill in quotePat
, quoteType
, and quoteDec
fields?
silly :: QuasiQuoter
silly = QuasiQuoter { quoteExp = \_ -> [| "yeah!!!" |] }