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<'?693186> -> DataSegmentKind
Type parameters: '?693186 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<'?693182> -> Choice<'?693182,'?693182>
Type parameters: '?693182

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