summaryrefslogtreecommitdiff
path: root/libraries/template-haskell/tests/typeToName.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/template-haskell/tests/typeToName.hs')
-rw-r--r--libraries/template-haskell/tests/typeToName.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/libraries/template-haskell/tests/typeToName.hs b/libraries/template-haskell/tests/typeToName.hs
new file mode 100644
index 0000000000..551de15978
--- /dev/null
+++ b/libraries/template-haskell/tests/typeToName.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
+module TypeToName where
+
+import Language.Haskell.TH.Syntax
+import Data.Proxy
+
+main :: IO $(return $ ConT $ typeConstructorName (Proxy @()) )
+main = return ()
+
+foo :: IO $(return $ ConT $ typeConstructorName (Proxy @Int) )
+foo = return 0
+
+qux :: IO ($(return $ ConT $ typeConstructorName (Proxy @(Int, Int) )) Int Int)
+qux = return (3, 4)
+