Skip to content

TaggedUnions

module TaggedUnions
AssemblyXantham.Generator

Functions and values

detectTaggedUnions: Pass<ShapeModel>

Declarations for the unions the checker proves are discriminated (D4, §4.5(2)): an F# DU of one payload per case, erased by Fable back to the object - Circle(radius = 2.0) becomes { kind: "circle", radius: 2 }. A named arm, and an arm more than its case's fields carry, is a case of one [<InlineInterface>] field, its interface: Ping of Ping compiles as the Ping value with the tag set. An arm with a call or construct signature leaves the union to shape-aliases. Each arm is a case of its own; arms sharing a tag value are told apart by each case's [<CaseTest>], and arms no test separates leave the union to shape-aliases. The DU binds the alias's type parameters and those it reads from the scope it was written in (§4.9): a payload of type T reads 'T. An application of a generic alias reads its declaration.