hash package:shake

Like hashWithSalt, but no salt is used. The default implementation uses hashWithSalt with some default salt. Instances might want to implement this method to provide a more efficient implementation than the default implementation.
Return a hash value for the argument, using the given salt. The general contract of hashWithSalt is:
  • If two values are equal according to the == method, then applying the hashWithSalt method on each of the two values must produce the same integer result if the same salt is used in each case.
  • It is not required that if two values are unequal according to the == method, then applying the hashWithSalt method on each of the two values must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal values may improve the performance of hashing-based data structures.
  • This method can be used to compute different hash values for the same input by providing a different salt in each application of the method. This implies that any instance that defines hashWithSalt must make use of the salt in its implementation.
  • hashWithSalt may return negative Int values.
The class of types that can be converted to a hash value. Minimal implementation: hashWithSalt. Note: the hash is not guaranteed to be stable across library versions, operating systems or architectures. For stable hashing use named hashes: SHA256, CRC32 etc. If you are looking for Hashable instance in time package, check time-compat
An alternative to to addOracle that relies on the hash function providing a perfect equality, doesn't support --skip, but requires less storage.
Get a checksum of a list of files, suitable for using as shakeVersion. This will trigger a rebuild when the Shake rules defined in any of the files are changed. For example:
main = do
ver <- getHashedShakeVersion ["Shakefile.hs"]
shakeArgs shakeOptions{shakeVersion = ver} ...
To automatically detect the name of the current file, turn on the TemplateHaskell extension and write $(LitE . StringL . loc_filename <$> location). This feature can be turned off during development by passing the flag --no-rule-version or setting shakeVersionIgnore to True.