Created
August 18, 2012 04:04
-
-
Save xenophobia/3384289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# Language TemplateHaskell, QuasiQuotes #-} | |
module ReifyTest where | |
import Language.Haskell.TH | |
import Language.Haskell.TH.Quote | |
import Data.Maybe | |
qq :: QuasiQuoter | |
qq = QuasiQuoter{quoteExp = \x -> litE . StringL .show =<< reify . fromJust =<< lookupValueName x} | |
--------------------------------------------------------------------- | |
{-# Language TemplateHaskell, QuasiQuotes #-} | |
import Language.Haskell.TH | |
import ReifyTest | |
test :: Int -> String | |
test x = [qq|x|] -- error! | |
-- reify2.2.hs:6:14: | |
-- x_a11C' is not in the type environment at a reify | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment