Пример #1
0
 /// <summary>
 /// Creates an unbounded interval with closed upper bound.
 /// </summary>
 public Interval <A> UnboundedClosedInterval(A upperBound)
 {
     return(Interval(upperBound: IntervalBound.Closed(upperBound)));
 }
Пример #2
0
 /// <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)));
 }
Пример #3
0
 /// <summary>
 /// Creates an unbounded interval with closed lower bound.
 /// </summary>
 public Interval <A> ClosedUnboundedInterval(A lowerBound)
 {
     return(Interval(lowerBound: IntervalBound.Closed(lowerBound)));
 }
Пример #4
0
        /// <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));
        }