[commit: packages/template-haskell] master: Use addDependentFile in quoteFile. (3701097)
git at git.haskell.org
git at git.haskell.org
Mon Nov 4 01:07:20 UTC 2013
Repository : ssh://git@git.haskell.org/template-haskell
On branch : master
Link : http://git.haskell.org/packages/template-haskell.git/commitdiff/37010971cce739c26d3eedbc2e9c1728b0eba33a
>---------------------------------------------------------------
commit 37010971cce739c26d3eedbc2e9c1728b0eba33a
Author: Austin Seipp <austin at well-typed.com>
Date: Sun Nov 3 17:32:38 2013 -0600
Use addDependentFile in quoteFile.
We'd expect recompilation if these files change.
Authored-by: Adam Vogt <vogt.adam at gmail.com>
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
37010971cce739c26d3eedbc2e9c1728b0eba33a
Language/Haskell/TH/Quote.hs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Language/Haskell/TH/Quote.hs b/Language/Haskell/TH/Quote.hs
index 3a13fe1..b9c0d25 100644
--- a/Language/Haskell/TH/Quote.hs
+++ b/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 }
More information about the ghc-commits
mailing list