add enum type (generalization of sum-type)
This commit is contained in:
parent
8653bb99c6
commit
0b262daf7f
6 changed files with 102 additions and 7 deletions
|
|
@ -1,12 +1,9 @@
|
|||
import { Unit } from "../primitives/types.js";
|
||||
import { unit } from "../primitives/unit.js";
|
||||
import { capitalizeFirstLetter } from "../util/util.js";
|
||||
import { constructorProduct, getLeft, getRight } from "./product.js";
|
||||
import { fnType, prodType } from "./types.js";
|
||||
|
||||
function capitalizeFirstLetter(val) {
|
||||
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
||||
}
|
||||
|
||||
// 'fields' is an array of (name: string, type: Type) pairs.
|
||||
// e.g.:
|
||||
// [{l: "x", r: Double}, {l: "y", r: Double}]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue