33 lines
974 B
JavaScript
33 lines
974 B
JavaScript
import {Int, Bool, Double} from "../primitives/symbols.js";
|
|
import { makeListModule } from "../structures/list_common.js";
|
|
import { makeProductType } from "../structures/product.js";
|
|
import { makeSumType } from "../structures/sum.js";
|
|
import { getListType, prodType, sumType } from "../type_registry.js";
|
|
|
|
const ListOfInt = getListType(Int);
|
|
const ListOfIntModule = makeListModule(Int);
|
|
|
|
const ListOfListOfInt = getListType(ListOfInt);
|
|
const ListOfListOfIntModule = makeListModule(ListOfInt);
|
|
|
|
export const ModuleValues = [
|
|
{i: 0n, t: Int},
|
|
{i: 42n, t: Int},
|
|
{i: false, t: Bool},
|
|
{i: 3.14159265359, t: Double},
|
|
|
|
{i: {l:[42n, 43n]} , t: ListOfInt},
|
|
{i: {l:[{l:[42n, 43n]}, {l:[999n]}]}, t: ListOfListOfInt},
|
|
|
|
// i'm lazy
|
|
...ListOfIntModule,
|
|
...ListOfListOfIntModule,
|
|
|
|
|
|
...makeProductType(Int, Bool),
|
|
|
|
...makeSumType(Int, Bool),
|
|
|
|
{i: {left: 42n, right: true}, t: prodType(Int, Bool)},
|
|
{i: {variant: "L", value: 100n}, t: sumType(Int, Bool)},
|
|
];
|