ValueOption Module
Functions and values
| Function or value |
Description
|
Full Usage:
ValueOption.ofCSharpTryPattern (status, value)
Parameters:
bool
value : 'a
Returns: 'a voption
Modifiers: inline Type parameters: 'a |
Converts a C# TryXxx
|
Full Usage:
ValueOption.ofPredicate predicate value
Parameters:
'T -> bool
-
The predicate to test the value with.
value : 'T
-
The value to conditionally wrap.
Returns: 'T voption
Modifiers: inline Type parameters: 'T |
Returns predicate is a function argument: per the null policy a null or throwing predicate is a programmer error, so it is called unguarded and any exception (including on a null delegate) propagates unchanged rather than being swallowed.
Example
Multiple items
module ValueOption from Microsoft.FSharp.Core -------------------- [<Struct>] type ValueOption<'T> = | ValueNone | ValueSome of 'T static member Some: value: 'T -> 'T voption static member op_Implicit: value: 'T -> 'T voption member IsNone: bool with get member IsSome: bool with get member Value: 'T with get static member None: 'T voption with get |
Full Usage:
ValueOption.tryCast value
Parameters:
obj
-
The boxed value to type-test.
Returns: 'T voption
Modifiers: inline Type parameters: 'T |
Type-guard cast: returns
Example
val boxed: obj
type obj = System.Object
val box: value: 'T -> objnull
Multiple items
module ValueOption from Microsoft.FSharp.Core -------------------- [<Struct>] type ValueOption<'T> = | ValueNone | ValueSome of 'T static member Some: value: 'T -> 'T voption static member op_Implicit: value: 'T -> 'T voption member IsNone: bool with get member IsSome: bool with get member Value: 'T with get static member None: 'T voption with get Multiple items
val string: value: 'T -> string -------------------- type string = System.String Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int |
TDesu.FSharp