UnionCaseType

PackageReified.Schema
Functions for defining explicit tagged union schema cases.

Specification

Kind
Type
Members
3
Examples
0
emptySignature
UnionCase.empty tag value isCase
valueSignature
UnionCase.value tag construct tryPayload payload
fieldsSignature
UnionCase.fields tag construct tryPayload payload

Summary

NameSignatureSynopsis
Operations
emptyUnionCase.empty tag value isCaseDescribes one payload-less case in a tagged union.
valueUnionCase.value tag construct tryPayload payloadDescribes a case with one arbitrary value payload.
fieldsUnionCase.fields tag construct tryPayload payloadDescribes a case whose payload schema is a record model and therefore has authored fields.

Operations

kind:member

empty

UnionCase.empty tag value isCase
Member
Describes one payload-less case in a tagged union.

Parameters

NameTypeDescription
tagstring
value'union
isCase'union -> bool

Returns

UnionCase<'union>
kind:member

value

UnionCase.value tag construct tryPayload payload
Member
Describes a case with one arbitrary value payload.

Parameters

NameTypeDescription
tagstring
construct'a -> 'b
tryPayload'b -> 'a option
payloadSchema<'a>

Returns

UnionCase<'b>
kind:member

fields

UnionCase.fields tag construct tryPayload payload
Member
Describes a case whose payload schema is a record model and therefore has authored fields.

Parameters

NameTypeDescription
tagstring
construct'payload -> 'union
tryPayload'union -> 'payload option
payloadSchema<'payload>

Returns

UnionCase<'union>