... |
... |
@@ -836,13 +836,17 @@ getPackageRoot = Q qGetPackageRoot |
836
|
836
|
--
|
837
|
837
|
-- * ghc -M does not know about these dependencies - it does not execute TH.
|
838
|
838
|
--
|
839
|
|
--- * The dependency is shallow, just a hash of its direct contents. It returns
|
840
|
|
--- a list of the contents (absolute paths), files and subdirectories both, so
|
841
|
|
--- you can manually depend on (a subset of) those, if you wish.
|
|
839
|
+-- * The dependency is shallow, just a hash of its direct contents.
|
|
840
|
+-- Basically, it only sees a list of names, and hashes those names.
|
|
841
|
+-- It does not look at directory metadata, recurse into subdirectories
|
|
842
|
+-- or look at file contents. As long as the list of names remains the same,
|
|
843
|
+-- the directory is considered unchanged.
|
|
844
|
+--
|
|
845
|
+-- * The state of the directory is read at the interface generation time,
|
|
846
|
+-- not at the time of the function call.
|
842
|
847
|
addDependentDirectory :: FilePath -> Q ()
|
843
|
848
|
addDependentDirectory dp = Q (qAddDependentDirectory dp)
|
844
|
849
|
|
845
|
|
-
|
846
|
850
|
-- | Record external files that runIO is using (dependent upon).
|
847
|
851
|
-- The compiler can then recognize that it should re-compile the Haskell file
|
848
|
852
|
-- when an external file changes.
|
... |
... |
@@ -853,7 +857,11 @@ addDependentDirectory dp = Q (qAddDependentDirectory dp) |
853
|
857
|
--
|
854
|
858
|
-- * ghc -M does not know about these dependencies - it does not execute TH.
|
855
|
859
|
--
|
856
|
|
--- * The dependency is based on file content, not a modification time
|
|
860
|
+-- * The dependency is based on file content, not a modification time or
|
|
861
|
+-- any other metadata associated with the file (e.g. permissions).
|
|
862
|
+--
|
|
863
|
+-- * The state of the file is read at the interface generation time,
|
|
864
|
+-- not at the time of the function call.
|
857
|
865
|
addDependentFile :: FilePath -> Q ()
|
858
|
866
|
addDependentFile fp = Q (qAddDependentFile fp)
|
859
|
867
|
|