Header menu logo Deedle

Ranges Module

 Provides F# functions for working with the `Ranges<'T>` type. Note that
 most of the functions are also exposed as members. The terminology in the
 functions below is:

  - **offset** refers to an absolute `int64` offset of a key in the range
  - **key** refers to a key value of type `'T`

 Say, you have daily range `[ (2015-01-01, 2015-01-10); (2015-02-01, 2015-02-10) ]`.
 Then, the keys are the dates and the offsets are 0 .. 9 for the first part and
 10 .. 19 for the second part.

Functions and values

Function or value Description

combine ranges

Full Usage: combine ranges

Parameters:
Returns: Ranges<'T>
Modifiers: inline
Type parameters: 'T

Combine ranges - the arguments don't have to be sorted, but must not overlap (they can be aligned, in which case ranges are merged)

ranges : Ranges<'T> seq
Returns: Ranges<'T>

create ops ranges

Full Usage: create ops ranges

Parameters:
Returns: Ranges<'T>
Modifiers: inline
Type parameters: 'T

Create a range from a sequence of low-high pairs and an explicitly specified range key operations

ops : IRangeKeyOperations<'T>
ranges : ('T * 'T) seq
Returns: Ranges<'T>

inlineCreate succ ranges

Full Usage: inlineCreate succ ranges

Parameters:
    succ : ^T -> int64 -> ^T
    ranges : (^T * ^T) seq

Returns: Ranges<^T>
Modifiers: inline
Type parameters: ^T

Create a range from a sequence of low-high pairs (range key operations used standard arithmetic)

succ : ^T -> int64 -> ^T
ranges : (^T * ^T) seq
Returns: Ranges<^T>

invalid

Full Usage: invalid

Returns: int64

Represents invalid offset

Returns: int64

keyAtOffset offs ranges

Full Usage: keyAtOffset offs ranges

Parameters:
    offs : int64
    ranges : Ranges<'T>

Returns: 'T
 Returns the key at a given offset. For example, given
 ranges [10..12; 30..32], the function defines a mapping:

   0->10, 1->11, 2->12, 3->30, 4->31, 5->32

 When the offset is wrong, throws `IndexOutOfRangeException`
offs : int64
ranges : Ranges<'T>
Returns: 'T

keyRange ranges

Full Usage: keyRange ranges

Parameters:
Returns: 'T * 'T
Modifiers: inline
Type parameters: 'T

Returns the smallest & greatest overall key

ranges : Ranges<'T>
Returns: 'T * 'T

keys ranges

Full Usage: keys ranges

Parameters:
Returns: 'T seq
Modifiers: inline
Type parameters: 'T

Returns a lazy sequence containing all keys

ranges : Ranges<'T>
Returns: 'T seq

length ranges

Full Usage: length ranges

Parameters:
Returns: int64
Modifiers: inline
Type parameters: 'T

Returns the length of the ranges

ranges : Ranges<'T>
Returns: int64

lookup key semantics check ranges

Full Usage: lookup key semantics check ranges

Parameters:
    key : 'T
    semantics : Lookup
    check : 'T -> int64 -> bool
    ranges : Ranges<'T>

Returns: OptionalValue<'T * int64>

Implements a lookup using the specified semantics & check function. For `Exact` match, this is the same as `offsetOfKey`. In other cases, we first find the place where the key *would* be and then scan in one or the other direction until 'check' returns 'true' or we find the end. Returns the key together with its offset in the range.

key : 'T
semantics : Lookup
check : 'T -> int64 -> bool
ranges : Ranges<'T>
Returns: OptionalValue<'T * int64>

offsetOfKey key ranges

Full Usage: offsetOfKey key ranges

Parameters:
    key : 'T
    ranges : Ranges<'T>

Returns: int64
 Returns the offset of a given key. For example, given
 ranges [10..12; 30..32], the function defines a mapping:

   10->0, 11->1, 12->2, 30->3, 31->4, 32->5

 When the key is wrong, returns `Ranges.invalid`
key : 'T
ranges : Ranges<'T>
Returns: int64

restrictRanges restriction ranges

Full Usage: restrictRanges restriction ranges

Parameters:
Returns: Ranges<'T>

Restricts the ranges according to the specified range restriction

restriction : RangeRestriction<'T>
ranges : Ranges<'T>
Returns: Ranges<'T>

Type something to start searching.