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<'a> -> 'a
Type parameters: 'a Attributes:
[<CompiledName("GetData")>]

Returns the data property of the specified DataSegment<T>

CompiledName: GetData

kind(ds)
Signature: ds:DataSegment<'?665646> -> DataSegmentKind
Type parameters: '?665646 Attributes:
[<CompiledName("GetKind")>]

Returns the kind property of the specified DataSegment<T>

CompiledName: GetKind

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

CompiledName: |Any|

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

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)

CompiledName: |Complete|Incomplete|

Fork me on GitHub