Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / PolyHash.adoc
1 PolyHash
2 ========
3
4 <:PolyHash:> is an optimization pass for the <:SSA:>
5 <:IntermediateLanguage:>, invoked from <:SSASimplify:>.
6
7 == Description ==
8
9 This pass implements polymorphic, structural hashing.
10
11 == Implementation ==
12
13 * <!ViewGitFile(mlton,master,mlton/ssa/poly-hash.fun)>
14
15 == Details and Notes ==
16
17 For each datatype, tycon, and vector type, it builds and equality
18 function and translates calls to `MLton_hash` into calls to that
19 function.
20
21 For tuples, it does the equality test inline; i.e., it does not create
22 a separate equality function for each tuple type.
23
24 All equality functions are created only if necessary, i.e., if
25 equality is actually used at a type.