Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Union-find-like data structure that defines equivalence classes of e-class ids.
Synopsis
- data ReprUnionFind
- emptyUF :: ReprUnionFind
- makeNewSet :: ReprUnionFind -> (ClassId, ReprUnionFind)
- unionSets :: ClassId -> ClassId -> ReprUnionFind -> (ClassId, ReprUnionFind)
- findRepr :: ClassId -> ReprUnionFind -> ClassId
Documentation
data ReprUnionFind Source #
A union find for equivalence classes of e-class ids.
Instances
Show ReprUnionFind Source # | |
Defined in Data.Equality.Graph.ReprUnionFind showsPrec :: Int -> ReprUnionFind -> ShowS # show :: ReprUnionFind -> String # showList :: [ReprUnionFind] -> ShowS # |
emptyUF :: ReprUnionFind Source #
The empty ReprUnionFind
.
:: ReprUnionFind | |
-> (ClassId, ReprUnionFind) | Newly created e-class id and updated |
Create a new e-class id in the given ReprUnionFind
.
:: ClassId | E-class id |
-> ClassId | E-class id |
-> ReprUnionFind | Union-find containing |
-> (ClassId, ReprUnionFind) | The new leader (always |
Union operation of the union find.
Given two leader ids, unions the two eclasses making a
the leader, that
is, b
is now represented by a