Variable enmConst

enm: any = ...

Stability

2 - provisional

Constructs a uoe-enum instance, which behaves like a tagged union.

An enum instance consists of a symbol and optionally some data.

The structure of an enum instance is { sym, data }.

Replacements:

  • [":sym"] -> :sym
  • [":data"] -> :data
  • [":then"] -> :then

Example

const pet = enm.cat({ name: "Fluffy" });
const bate = enm.fish;
draw_animals(tup([pet, bate])({
stroke: enm.no_stroke,
fill: enm.with_fill.gradient(tup(enm.red, enm.blue))
}));

Generated using TypeDoc