Documentation

This provides a generic hashWithSalt implementation for one type at a
time. If the type of the value gHashWithSalt is asked to hash
contains values of other types, those types have to provide
Hashable instances. This also means that recursive types can only
be used with gHashWithSalt if a Hashable instance has been defined
as well (see examples below).

The typical usage for gHashWithSalt is for reducing boilerplate code
when defining Hashable instances for ordinary algebraic
datatypes. See the code below for some simple usage examples:

This integer need not remain consistent from one execution
of an application to another execution of the same
application.

If two values are equal according to the == method, then
applying the hash method on each of the two values must
produce the same integer result.

It is not required that if two values are unequal
according to the == method, then applying the hash
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.