Last active
August 29, 2015 14:19
-
-
Save tokiwoousaka/69165be983834d427416 to your computer and use it in GitHub Desktop.
THのlocation関数テスト
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#-} | |
module Main where | |
import Language.Haskell.TH | |
$( do | |
location >>= runIO . (\loc -> do | |
putStrLn $ loc_filename loc -- THの書かれたファイル名 | |
putStrLn $ loc_package loc -- パッケージ名 | |
putStrLn $ loc_module loc -- モジュール名 | |
print $ loc_start loc -- ソースコード上のマクロの開始位置(行, 列) | |
print $ loc_end loc -- マクロの終了位置(行, 列) | |
) | |
return [] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment