A persistent, but not so efficient unionfind structure.
 newtype UnionFind a = UnionFind {
 unUnionFind :: Map a a
 con_UnionFind :: Constr
 ty_T :: DataType
 unionFind :: Ord a => Map a a > UnionFind a
 map :: (Ord a, Ord b) => (a > b) > UnionFind a > UnionFind b
 empty :: UnionFind a
 size :: UnionFind a > Int
 equate :: Ord a => a > a > UnionFind a > UnionFind a
 fromList :: Ord a => [(a, a)] > UnionFind a
 equateList :: Ord a => UnionFind a > [(a, a)] > UnionFind a
 toList :: UnionFind a > [(a, a)]
 union :: Ord a => UnionFind a > UnionFind a > UnionFind a
 find :: Ord a => a > UnionFind a > Maybe a
 findWithDefault :: Ord a => a > a > UnionFind a > a
 equiv :: Ord a => (a, a) > UnionFind a > Bool
Documentation
UnionFind  

unionFind :: Ord a => Map a a > UnionFind aSource
Smart constructor from a Map
to a unionfind structure.
equate :: Ord a => a > a > UnionFind a > UnionFind aSource
equate x y uf
inserts the equality x = y
into uf
.
equateList :: Ord a => UnionFind a > [(a, a)] > UnionFind aSource
find :: Ord a => a > UnionFind a > Maybe aSource
find x uf
returns the representative of the equivalence class that x
belongs to in uf
, if there is any.
findWithDefault :: Ord a => a > a > UnionFind a > aSource
findWithDefault def x uf
returns the representative of the equivalence
class that x
belongs to in uf
or def
, if there is no representative.