Deedle


DataSegment

Namespace: Deedle

Provides helper functions and active patterns for working with DataSegment values

Functions and values

Function or valueDescription
data ds
Signature: ds:DataSegment<'?497862> -> '?497862
Type parameters: '?497862

Returns the data property of the specified DataSegment<T>

kind ds
Signature: ds:DataSegment<'?497864> -> DataSegmentKind
Type parameters: '?497864

Returns the kind property of the specified DataSegment<T>

Active patterns

Active patternDescription
( |Any| ) ds
Signature: ds:DataSegment<'T> -> DataSegmentKind * 'T
Type parameters: 'T

A complete active pattern that extracts the kind and data from a DataSegment value. This makes it easier to write functions that only need data:

let sumAny = function DataSegment.Any(_, data) -> Stats.sum data

( |Complete|Incomplete| ) ds
Signature: ds:DataSegment<'?497860> -> Choice<'?497860,'?497860>
Type parameters: '?497860

Complete active pattern that makes it possible to write functions that behave differently for complete and incomplete segments. For example, the following returns zero for incomplete segments:

1: 
2: 
3: 
let sumSegmentOrZero = function
  | DataSegment.Complete(value) -> Stats.sum value
  | DataSegment.Incomplete _ -> 0.0
val sumSegmentOrZero : (obj -> obj)

Full name: docs.sumSegmentOrZero
Fork me on GitHub