Created
November 5, 2011 17:09
-
-
Save gregwebs/1341783 to your computer and use it in GitHub Desktop.
addDependentFile
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
module External where | |
import Language.Haskell.TH.Syntax | |
import Language.Haskell.TH.Lib | |
loadStringFromFile :: Q Exp | |
loadStringFromFile = do | |
let externalDependency = "external.txt" | |
qAddDependentFile externalDependency | |
s <- qRunIO $ readFile externalDependency | |
stringE s |
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
Change Me! |
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
-- main.hs | |
{-# LANGUAGE TemplateHaskell #-} | |
module Main where | |
import External (loadStringFromFile) | |
main :: IO () | |
main = putStrLn $loadStringFromFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment