blob: 5ae77b902351a0976334a1bf4bc6e1c6bf162c0f (
plain)
1
2
3
4
5
6
7
8
9
10
|
:set -XTemplateHaskell
import Language.Haskell.TH
let seeType n = do VarI _ t _ <- reify n; runIO $ putStrLn $ show t; [| return True |]
let f = undefined :: Int -> Int
let g = undefined :: [Int]
let h = undefined :: (Int, Int)
$(seeType (mkName "f"))
$(seeType (mkName "g"))
$(seeType (mkName "h"))
|