Liking cljdoc? Tell your friends :D

hier-set.core

Provides a 'hierarchical set' data structure. See hier-set for details.

Provides a 'hierarchical set' data structure.  See `hier-set` for details.
raw docstring

hier-setclj

(hier-set hcontains? & keys)

Constructs a hierarchical set with the containment predicate hcontains? and primary members keys. The hcontains? predicate should be a function of two arguments over the type of the set elements; it should return true if the first argument contains the second, and false otherwise.

A hierarchical set is a set of elements which may hierarchically contain other elements. The hierarchical relationship is defined by the element sort-order and the hcontains? predicate, with the following constraints: (a) elements must sort prior to any descendants; and (b) elements must contain all elements which sort between themselves and any descendant. Note that this means that (hcontains? x x) must be true, and that elements are thus considered to be both ancestors and descendants of themselves.

Lookup in the set returns a seq of all primary members which are ancestors of the provided key, or nil if the provided key is not a descendant of any primary member.

Constructs a hierarchical set with the containment predicate `hcontains?`
and primary members `keys`.  The `hcontains?` predicate should be a function of
two arguments over the type of the set elements; it should return `true` if the
first argument contains the second, and false otherwise.

A hierarchical set is a set of elements which may hierarchically contain other
elements.  The hierarchical relationship is defined by the element sort-order
and the `hcontains?` predicate, with the following constraints: (a) elements
must sort prior to any descendants; and (b) elements must contain all elements
which sort between themselves and any descendant.  Note that this means
that `(hcontains? x x)` must be true, and that elements are thus considered to
be both ancestors and descendants of themselves.

Lookup in the set returns a seq of all primary members which are ancestors of
the provided key, or nil if the provided key is not a descendant of any primary
member.
sourceraw docstring

hier-set-byclj

(hier-set-by hcontains? comparator & keys)

As hier-set, but specifying the comparator to use for element comparison.

As hier-set, but specifying the comparator to use for element comparison.
sourceraw docstring

Hierarchicalcljprotocol

Operations on collections defining hierarchical relationships.

Operations on collections defining hierarchical relationships.

ancestorsclj

(ancestors coll key)
(ancestors coll key strict?)

Return a lazy sequence of all ancestors of key in coll. Do not include key if strict? is true, defaulting to false.

Return a lazy sequence of all ancestors of `key` in `coll`.  Do not
include `key` if `strict?` is true, defaulting to false.

descendantsclj

(descendants coll key)
(descendants coll key strict?)

Return a lazy sequence of all descendants of key in coll. Do not include key if strict? is true, defaulting to false.

Return a lazy sequence of all descendants of `key` in `coll`.  Do not
include `key` if `strict?` is true, defaulting to false.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close