diff options
author | Austin Seipp <austin@well-typed.com> | 2013-11-03 17:32:38 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2013-11-03 17:32:38 -0600 |
commit | 28ef0bdfebdd37480e18d8bbacfda82f67cfa6fb (patch) | |
tree | 1a1a39699a49d6565b3d1d7a04e7df3a876011e1 /libraries | |
parent | 336e94d8d5149789f0f6882a52d2528265107652 (diff) | |
download | haskell-28ef0bdfebdd37480e18d8bbacfda82f67cfa6fb.tar.gz |
Use addDependentFile in quoteFile.
We'd expect recompilation if these files change.
Authored-by: Adam Vogt <vogt.adam@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Quote.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/Quote.hs b/libraries/template-haskell/Language/Haskell/TH/Quote.hs index 3a13fe1bb1..b9c0d25d2b 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Quote.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Quote.hs @@ -75,7 +75,7 @@ dataToPatQ = dataToQa id litP conP -- the data out of a file. For example, suppose 'asmq' is an -- assembly-language quoter, so that you can write [asmq| ld r1, r2 |] -- as an expression. Then if you define @asmq_f = quoteFile asmq@, then --- the quote [asmq_f| foo.s |] will take input from file "foo.s" instead +-- the quote [asmq_f|foo.s|] will take input from file @"foo.s"@ instead -- of the inline text quoteFile :: QuasiQuoter -> QuasiQuoter quoteFile (QuasiQuoter { quoteExp = qe, quotePat = qp, quoteType = qt, quoteDec = qd }) @@ -83,4 +83,5 @@ quoteFile (QuasiQuoter { quoteExp = qe, quotePat = qp, quoteType = qt, quoteDec where get :: (String -> Q a) -> String -> Q a get old_quoter file_name = do { file_cts <- runIO (readFile file_name) + ; addDependentFile file_name ; old_quoter file_cts } |