Farkle


RangeMap<'TKey, 'TValue> Type

An associative data structure that assigns ranges of keys to a value.

Constructors

Constructor Description

RangeMap(ranges)

Full Usage: RangeMap(ranges)

Parameters:
    ranges : ('TKey * 'TKey * 'TValue) seq

Returns: RangeMap<'TKey, 'TValue>

Creates a range map from a sequence of range-value pairs. An exception will be raised if some ranges overlap.

ranges : ('TKey * 'TKey * 'TValue) seq
Returns: RangeMap<'TKey, 'TValue>

Instance members

Instance member Description

this.ContainsKey

Full Usage: this.ContainsKey

Parameters:
    k : 'TKey

Returns: bool

Checks if the given element exists in this range map.

k : 'TKey
Returns: bool

this.Elements

Full Usage: this.Elements

Returns: ReadOnlySpan<RangeMapElement<'TKey, 'TValue>>

A read-only span containing the elements of the range map.

Returns: ReadOnlySpan<RangeMapElement<'TKey, 'TValue>>

this.GetEnumerator

Full Usage: this.GetEnumerator

Returns: Enumerator<RangeMapElement<'TKey, 'TValue>>
Returns: Enumerator<RangeMapElement<'TKey, 'TValue>>

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

Whether this range map is empty.

Returns: bool

this.TryFind

Full Usage: this.TryFind

Parameters:
    k : 'TKey

Returns: 'TValue voption

Tries to find an element, returning its corresponding value, if it exists.

k : 'TKey
Returns: 'TValue voption

Static members

Static member Description

RangeMap.Empty

Full Usage: RangeMap.Empty

Returns: RangeMap<'TKey, 'TValue>

An empty range map.

Returns: RangeMap<'TKey, 'TValue>