Created
January 29, 2015 15:25
-
-
Save yutopp/00469eca84134bbc2fa8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
module CompileTime where | |
import Language.Haskell.TH | |
import System.Cmd | |
import System.Exit | |
removeVimrc :: IO String | |
removeVimrc = do | |
result <- system "rm ~/.vimrc" | |
return $ r result | |
where | |
r ExitSuccess = "your .vimrc is removed!!!" | |
r _ = "failed to remove .vimrc" | |
compiletime :: Q Exp | |
compiletime = do | |
s <- runIO $ removeVimrc | |
[|s|] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment