/// <summary> /// Creates an unbounded interval with closed upper bound. /// </summary> public Interval <A> UnboundedClosedInterval(A upperBound) { return(Interval(upperBound: IntervalBound.Closed(upperBound))); }
/// <summary> /// Creates a closed interval with the specified bounds. /// </summary> public Interval <A> ClosedInterval(A lowerBound, A upperBound) { return(Interval(IntervalBound.Closed(lowerBound), IntervalBound.Closed(upperBound))); }
/// <summary> /// Creates an unbounded interval with closed lower bound. /// </summary> public Interval <A> ClosedUnboundedInterval(A lowerBound) { return(Interval(lowerBound: IntervalBound.Closed(lowerBound))); }
/// <summary> /// Creates a new degenerate interval that consists of just one value. /// </summary> public Interval <A> SingleValueInterval(A value) { var bound = IntervalBound.Closed(value).ToOption(); return(new Interval <A>(bound, bound, isEmpty: false)); }