union-find-array-0.1: union find data structure

Data.Union

Description

Immutable disjoint set forests.

Synopsis

data Union a Source

An immutable disjoint set forest.

newtype Node Source

A node in a disjoint set forest.

Constructors

Fields

Instances

size :: Union l -> IntSource

Get the number of nodes in the forest.

lookup :: Union l -> Node -> (Node, l)Source

Look up the representative of a node, and its label.

lookupFlattened :: Union a -> Node -> (Node, a)Source

Version of lookup that assumes the forest to be flattened. (cf. flatten.)

lookup

flatten

Do not use otherwise: It will give wrong results!