UnionCaseModule
PackageReified.Schema
Functions for defining explicit tagged union schema cases.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| empty | UnionCase.empty tag value isCase | Describes one payload-less case in a tagged union. |
| value | UnionCase.value tag construct tryPayload payload | Describes a case with one arbitrary value payload. |
| fields | UnionCase.fields tag construct tryPayload payload | Describes a case whose payload schema is a record model and therefore has authored fields. |
Describes one payload-less case in a tagged union.
Parameters
| Name | Type | Description |
|---|---|---|
| tag | string | |
| value | 'union | |
| isCase | 'union -> bool |
Returns
UnionCase<'union>
Describes a case with one arbitrary value payload.
Parameters
| Name | Type | Description |
|---|---|---|
| tag | string | |
| construct | 'a -> 'b | |
| tryPayload | 'b -> 'a option | |
| payload | Schema<'a> |
Returns
UnionCase<'b>