Union Module
Reflection helpers for F# discriminated unions: the case name a value was built with, and the full set of case names for a union type.
Example
type Status =
| Active
| Suspended of reason: string
Union.caseName Active // "Active"
Union.caseName (Suspended "abuse") // "Suspended"
Union.caseNames<Status> () // [| "Active"; "Suspended" |]
type Status =
| Active
| Suspended of reason: string
Multiple items
val string: value: 'T -> string
--------------------
type string = System.String
val string: value: 'T -> string
--------------------
type string = System.String
Functions and values
| Function or value |
Description
|
||
Full Usage:
Union.caseName value
Parameters:
'T
-
The union value to inspect.
Returns: string
|
The name of the case value was built with.
|
||
Full Usage:
Union.caseNames ()
Parameters:
unit
Returns: string[]
|
Every case name of
|
TDesu.FSharp