hash package:parameterized-utils

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.
Hash with default salt.
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. Hashable is intended exclusively for use in in-memory data structures. . Hashable does not have a fixed standard. This allows it to improve over time. . Because it does not have a fixed standard, different computers or computers on different versions of the code will observe different hash values. As such, Hashable is not recommended for use other than in-memory datastructures. Specifically, Hashable is not intended for network use or in applications which persist hashed values. For stable hashing use named hashes: sha256, crc32, xxhash etc. If you are looking for Hashable instance in time package, check time-compat
A parameterized type that is hashable on all instances.
This module provides a ST-based hashtable for parameterized keys and values. NOTE: This API makes use of unsafeCoerce to implement the parameterized hashtable abstraction. This should be type-safe provided that the TestEquality instance on the key type is implemented soundly.
A hash table mapping nonces to values.
A parameterized class for types which can be hashed, when given functions to hash parameterized subterms.
Deprecated: Use structuralHashWithSalt
structuralHashWithSalt tp generates a function with the type Int -> tp -> Int that hashes type. The second arguments is for generating user-defined patterns to replace hashWithSalt for specific types.