You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Library providing a "hierarchical set" data structure. The provided data
structure is set of elements with a defined hierarchical relationship. An
element is considered to be in the set either if it is provided as a primary
set member or if it is a descendant of any such element. Lookup in the set not
only determines set membership, but also finds all primary set members which
are ancestors of the lookup element.
The hierarchical relationship is defined by the element sort-order and a
separate containment predicate, with the following constraints:
elements must sort prior to any descendants; and
elements must contain all elements which sort between themselves and any
descendant.
This is sufficient to represent simple hierarchical systems where the hierarchy
is implicit in the entities involved, such as the Java package system,
hierarchical filesystems, or IP networks. It is inappropriate for modeling
complex, ad hoc hierarchies, such as the relationships between classes with
multiple inheritance.
Usage
Add hier-set to the :dependencies list in your
Leiningenproject.clj:
[hier-set "1.1.2"]
Primary usage is then through the hier-set and hier-set-by constructor
functions in the hier-set.core namespace. In addition to set lookup as
described above, the hier-set.core/ancestors and hier-set.core/descendants
functions also provide access to lazy sequences of the ancestors and
descendants respectively of a provided key.