ClosedIntervals.Tree (closed_intervals v0.6.0) View Source
Functions to manipulate a tree of closed intervals.
Library users will often use the ClosedIntervals
struct,
which contains a tree together with matching order and equality comparison functions.
This module contains utilities for direct manipulations on the tree structure,
many of which are reexported in ClosedIntervals
.
Link to this section Summary
Functions
Construct a tree from a sorted list of data.
Create a tree with two leaves from the left and right bounds.
Get all intervals to which the given navigation function return :eq
.
This is the internal tree representation. It is not intended to be used publicly.
Link to this section Types
Specs
comparison() :: :lt | :eq | :gt
Specs
Link to this section Functions
Construct a tree from a sorted list of data.
Specs
from_bounds({data, data}) :: t(data) when data: var
Create a tree with two leaves from the left and right bounds.
Specs
get_all_intervals_by(t(data), (data -> comparison())) :: [ ClosedIntervals.interval(data) ] when data: var
Get all intervals to which the given navigation function return :eq
.
The function navigation/1
says whether a given position is less than, greater than,
or equal to the desired position.
Specs
This is the internal tree representation. It is not intended to be used publicly.