Range<SELF, MonoidOrdA, A> Class

Represents a range of values

DECLARATION
[Serializable]
public class Range<SELF, MonoidOrdA, A> : IEnumerable<A>
NAMESPACE
LanguageExt

Constructors

Range(A, A, A)
SUMMARY

Construct a range

PARAMETERS
from
A
The minimum value in the range
to
A
The maximum value in the range
step
A
The size of each step in the range
DECLARATION
[Pure]
protected ctor Range(A from, A to, A step)

Fields

From
SUMMARY

First value in the range

DECLARATION
public readonly A From
Step
SUMMARY

Step size to the next item in the range

DECLARATION
public readonly A Step
StepIsAscending
SUMMARY

True if adding step to n makes the resulting value greater than n

DECLARATION
public readonly bool StepIsAscending
To
SUMMARY

Last (inclusive) value in the range

DECLARATION
public readonly A To
Zero
SUMMARY

Zero range using MonoidOrdA.Empty()

DECLARATION
public static readonly SELF Zero

Methods

AsEnumerable()
DECLARATION
[Pure]
public IEnumerable<A> AsEnumerable()
RETURNS
IEnumerable<A>
Fold<S>(S, Func<S, A, S>)
PARAMETERS
state
S
f
Func<S, A, S>
DECLARATION
[Pure]
public S Fold<S>(S state, Func<S, A, S> f)
RETURNS
S
FromCount(A, A, A)
SUMMARY

Construct a new range

PARAMETERS
min
A
count
A
The number of items in the range
step
A
The size of each step in the range
DECLARATION
[Pure]
public static SELF FromCount(A min, A count, A step)
RETURNS
SELF
FromMinMax(A, A, A)
SUMMARY

Construct a new range

PARAMETERS
min
A
max
A
step
A
The size of each step in the range
DECLARATION
[Pure]
public static SELF FromMinMax(A min, A max, A step)
RETURNS
SELF
GetEnumerator()
DECLARATION
[Pure]
public IEnumerator<A> GetEnumerator()
RETURNS
IEnumerator<A>
InRange(A)
SUMMARY

Returns true if the value provided is in range

PARAMETERS
value
A
Value to test
DECLARATION
[Pure]
public bool InRange(A value)
RETURNS
bool
True if the value provided is in range
Overlaps(SELF)
SUMMARY

Returns true if the range provided overlaps this range

PARAMETERS
other
SELF
The range to test
DECLARATION
[Pure]
public bool Overlaps(SELF other)
RETURNS
bool
True if the range provided overlaps this range
ToSeq()
DECLARATION
[Pure]
public Seq<A> ToSeq()
RETURNS
Seq<A>