Chan package:shake

How should you determine if a file has changed, used by shakeChange. The most common values are ChangeModtime (the default, very fast, touch causes files to rebuild) and ChangeModtimeAndDigestInput (slightly slower, touch and switching git branches does not cause input files to rebuild).
Compare equality of file contents digests, a file has changed if its digest changes. A touch will not force a rebuild. Use this mode if modification times on your file system are unreliable.
Compare equality of modification timestamps, a file has changed if its last modified time changes. A touch will force a rebuild. This mode is fast and usually sufficiently accurate, so is the default.
A file is rebuilt if both its modification time and digest have changed. For efficiency reasons, the modification time is checked first, and if that has changed, the digest is checked.
Use ChangeModtimeAndDigest for input/source files and ChangeModtime for output files. An input file is one which is a dependency but is not built by Shake as it has no matching rule and already exists on the file system.
A file is rebuilt if either its modification time or its digest has changed. A touch will force a rebuild, but even if a files modification time is reset afterwards, changes will also cause a rebuild.
Nothing has changed.
I recomputed the value and it was different.
I recomputed the value and it was the same.
The stored value has changed, but in a way that should be considered identical (used rarely).
copyFileChanged old new copies the existing file from old to new, if the contents have changed. The old file will be tracked as a dependency. Also creates the new directory if necessary.
Like need but returns a list of rebuilt dependencies since the calling rule last built successfully. The following example writes a list of changed dependencies to a file as its action.
"target" %> \out -> do
let sourceList = ["source1", "source2"]
rebuildList <- needHasChanged sourceList
writeFileLines out rebuildList
This function can be used to alter the action depending on which dependency needed to be rebuild. Note that a rule can be run even if no dependency has changed, for example because of shakeRebuild or because the target has changed or been deleted. To detect the latter case you may wish to use resultHasChanged.
Has a file changed. This function will only give the correct answer if called in the rule producing the file, before the rule has modified the file in question. Best avoided, but sometimes necessary in conjunction with needHasChanged to cause rebuilds to happen if the result is deleted or modified.
Default to ChangeModtime. How to check if a file has changed, see Change for details.
Write a file, but only if the contents would change.
How the output of a rule has changed.
At least one of my dependencies from last time have changed, or I have no recorded dependencies.
How has the RunResult changed from what happened last time.