Skip to main content

Module discriminated

Module discriminated 

Source
Expand description

A discriminated union: the branch is chosen by the value of a tag property and the value validated against that branch alone, so the errors are its own rather than a list of every alternative.

Structs§

Disc
The tag of a discriminated union and its branch names, sorted. The branches themselves are the node’s list, in that order.

Functions§

discriminated
A union choosing its branch by the value of the tag property. An object-shaped branch without the tag property has it added, as the literal it is keyed by.