rangex v0.1.0 Rangex.RangeList

Link to this section Summary

Functions

Cut the range_list to contain all elements before the marker to

Cut the range_list to contain all elements after the marker from

returns the longest gap between two successive ranges in the list. Returns a range describing the gap. The list must be sorted

Link to this section Functions

Link to this function add_range(range_list, to_insert, options \\ [sorted: true])

adds a range to a range_list.

Link to this function cut_after(range_list, to, options \\ [])

Cut the range_list to contain all elements before the marker to

In case an individual range encloses from the behaviour is giben by the option :overlapping:

  • :cut cuts the range to end with to
  • :drop [or false] drops the range from the result
  • :include [or true or any other value] includes the overlapping range as is

The to argument is matched excluding it’s own value(as with the to component of a range).

Link to this function cut_before(range_list, from, options \\ [])

Cut the range_list to contain all elements after the marker from

In case an individual range encloses from the behaviour is giben by the option :overlapping:

  • :cut cuts the range to start with from
  • :drop [or false] drops the range from the result
  • :include [or true or any other value] includes the overlapping range as is

The from argument is matched inclusively.

Link to this function longest_gap(range_list, big_range \\ nil)

returns the longest gap between two successive ranges in the list. Returns a range describing the gap. The list must be sorted