pubgrub/version_ranges

Types

pub type Bound(a) {
  Unbounded
  Included(a)
  Excluded(a)
}

Constructors

  • Unbounded
  • Included(a)
  • Excluded(a)
pub type Compare(a) =
  fn(a, a) -> order.Order
pub type Interval(a) =
  #(Bound(a), Bound(a))
pub type Ranges(a) {
  Ranges(
    segments: List(#(Bound(a), Bound(a))),
    compare: fn(a, a) -> order.Order,
  )
}

Constructors

Values

pub fn between(
  compare: fn(a, a) -> order.Order,
  lower: a,
  upper: a,
) -> Ranges(a)
pub fn compare(ranges: Ranges(a)) -> fn(a, a) -> order.Order
pub fn complement(ranges: Ranges(a)) -> Ranges(a)
pub fn contains(ranges: Ranges(a), value: a) -> Bool
pub fn empty(compare: fn(a, a) -> order.Order) -> Ranges(a)
pub fn equal(left: Ranges(a), right: Ranges(a)) -> Bool
pub fn from_range_bounds(
  compare: fn(a, a) -> order.Order,
  start: a,
  end: a,
) -> Ranges(a)
pub fn full(compare: fn(a, a) -> order.Order) -> Ranges(a)
pub fn higher_than(
  compare: fn(a, a) -> order.Order,
  value: a,
) -> Ranges(a)
pub fn intersection(
  left: Ranges(a),
  right: Ranges(a),
) -> Ranges(a)
pub fn is_disjoint(left: Ranges(a), right: Ranges(a)) -> Bool
pub fn is_empty(ranges: Ranges(a)) -> Bool
pub fn is_full(ranges: Ranges(a)) -> Bool
pub fn lower_than(
  compare: fn(a, a) -> order.Order,
  value: a,
) -> Ranges(a)
pub fn singleton(
  compare: fn(a, a) -> order.Order,
  value: a,
) -> Ranges(a)
pub fn strictly_higher_than(
  compare: fn(a, a) -> order.Order,
  value: a,
) -> Ranges(a)
pub fn strictly_lower_than(
  compare: fn(a, a) -> order.Order,
  value: a,
) -> Ranges(a)
pub fn subset_of(subset: Ranges(a), container: Ranges(a)) -> Bool
pub fn to_string(
  ranges: Ranges(a),
  value_to_string: fn(a) -> String,
) -> String
pub fn union(left: Ranges(a), right: Ranges(a)) -> Ranges(a)
Search Document