rangex v0.1.0 Rangex.Range protocol
Common range calculations
Link to this section Summary
Functions
the first range and the second one have a common [point] boundary
two ranges that do not share an intersection range
extracts the from
component
The first range includes the second completely
Merges the first and the second range, if they are mergeable
same as &extend/2
but throws if the range cannot be extended
returns true if two ranges are mergeable, false otherwhise Ths prevents joining of ranges which would otherwhise be adiacent or overlapping returns false in case of non-sdiacent and non-overlapping ranges
creates a new rtange objexct from from
and to
two ranges that do share a intersection range
extracts the to
component
Link to this section Types
Link to this section Functions
the first range and the second one have a common [point] boundary
two ranges that do not share an intersection range
extracts the from
component
The first range includes the second completely
Merges the first and the second range, if they are mergeable.
This has the implicit meaning that this holds:
(overlap(range1,range2) or adiacent(range1,range2)) == true
).
&mergeable?/2
Ranges will be merged by
- combining from/to to their respective min/max
- combining other data of both
Range
objects into one
Returns either {:ok, Range.t}
or :error if the two are not mergeable
same as &extend/2
but throws if the range cannot be extended
returns true if two ranges are mergeable, false otherwhise Ths prevents joining of ranges which would otherwhise be adiacent or overlapping returns false in case of non-sdiacent and non-overlapping ranges
creates a new rtange objexct from from
and to
two ranges that do share a intersection range
extracts the to
component