HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Data.UnionFind

  • 2 types
  • 7 values
  • Packageghc-9.10.3
  • Exports9
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceUnionFind.hs
newtypenewtype Point s a
#

A variable which can be unified; alternately, this can be thought of as an equivalence class with a distinguished representative.

Constructors

Instances1Eq
  • Eq (Point s a)Defined in ghc-9.10.3 · GHC.Data.UnionFind
valuefresh :: a -> ST s (Point s a)
#

Create a fresh equivalence class with one element.

valuerepr :: Point s a -> ST s (Point s a)
#

Flatten any chains of links, returning a Point which points directly to the canonical representation.

valuefind :: Point s a -> ST s a
#

Return the canonical element of an equivalence class Point.

valueunion :: Point s a -> Point s a -> ST s ()
#

Unify two equivalence classes, so that they share a canonical element. Keeps the descriptor of point2.