UrefSourceUnion-find with union by rank and path compression
This is an implementation of Tarjan's union-find data structure using generics. The interface is analagous to standard references, with the addition of a union operation which makes two references indistinguishable.
Test whether two urefs share the same equivalence class
unify f (p,q) unifies references p and q, making them indistinguishable. The contents of the reference are the result of f