IntervalRecord

Operations over inclusive ranges of ordered values.

Fields

NameTypeDescription
singletonInterval.singleton valueBuilds the interval containing exactly one value.
betweenInterval.between first secondBuilds the smallest interval containing both values, ordering them as needed.
createInterval.create lower upperBuilds an interval from a pair the caller asserts is already ordered, failing when it is not.
lowerInterval.lower intervalReturns the inclusive lower bound.
upperInterval.upper intervalReturns the inclusive upper bound.
toPairInterval.toPair intervalReturns the bounds as a pair.
isSingletonInterval.isSingleton intervalReturns whether the interval contains exactly one value.
containsInterval.contains value intervalReturns whether the value lies within the inclusive bounds.
containsIntervalInterval.containsInterval inner outerReturns whether every value of the inner interval lies within the outer one.
overlapsInterval.overlaps first secondReturns whether the two intervals share at least one value.
intersectInterval.intersect first secondReturns the shared portion of two intervals, or None when they are disjoint.
unionInterval.union first secondReturns the combined interval when the two overlap, or None when a gap between them would have to be invented.
spanInterval.span first secondReturns the smallest interval containing both inputs, gap included.
extendToInterval.extendTo value intervalReturns the smallest interval containing the input and the value.
ofNonEmptyListInterval.ofNonEmptyList valuesReturns the smallest interval containing every supplied value.
clampInterval.clamp value intervalRestricts a value to the interval's bounds.
mapMonotonicInterval.mapMonotonic mapping intervalApplies a mapping to both bounds.
toConstraintInterval.toConstraint intervalReturns the portable constraint that admits exactly this interval's values.
durationInterval.duration intervalReturns how long an interval of instants lasts.
widthIntInterval.widthInt intervalReturns the distance between the bounds.
widthDecimalInterval.widthDecimal intervalReturns the distance between the bounds.
refinementInterval.refinement intervalReturns a refinement admitting values that lie within the interval.
Upperthis.UpperReturns the inclusive upper bound.
Lowerthis.LowerReturns the inclusive lower bound.
LowerValueLowerValueNo description available.
UpperValueUpperValueNo description available.