A UniqDFM whose domain is sets of Uniques, each of which share a
common value of type ele.
Every such set ("equivalence class") has a distinct representative
Unique. Supports merging the entries of multiple such sets in a union-find
like fashion.
An accurate model is that of [(Set key, Maybe ele)]: A finite mapping from
sets of keys to possibly absent entries ele, where the sets don't overlap.
Example:
m = [({u1,u3}, Just ele1), ({u2}, Just ele2), ({u4,u7}, Nothing)]
On this model we support the following main operations:
lookupUSDFM m u3 == Just ele1,lookupUSDFM m u4 == Nothing,lookupUSDFM m u5 == Nothing.equateUSDFM m u1 u3is a no-op, butequateUSDFM m u1 u2merges{u1,u3}and{u2}to point toJust ele2and returns the old entry of{u1,u3},Just ele1.addToUSDFM m u3 ele4sets the entry of{u1,u3}toJust ele4.
As well as a few means for traversal/conversion to list.
Instances1Outputable
(Outputable key, Outputable ele) => Outputable (UniqSDFM key ele)Defined in ghc-9.10.3 · GHC.Types.Unique.SDFM