Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created January 29, 2015 15:25
Show Gist options
  • Save yutopp/00469eca84134bbc2fa8 to your computer and use it in GitHub Desktop.
Save yutopp/00469eca84134bbc2fa8 to your computer and use it in GitHub Desktop.
{-# 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