rename some things

This commit is contained in:
Joeri Exelmans 2025-04-20 21:09:51 +02:00
parent e04cac4f7d
commit 8a4bd44f04
16 changed files with 92 additions and 60 deletions

26
versioning/types.js Normal file
View file

@ -0,0 +1,26 @@
import { Dynamic } from "../primitives/dynamic.js";
import { Int } from "../primitives/types.js";
import { enumType } from "../structures/enum.js";
import { newProduct } from "../structures/product.js";
import { structType } from "../structures/struct.js";
import { prettyT, prodType } from "../structures/types.js";
const Slot = structType([
newProduct("value")(() => Value),
newProduct("depth")(() => Int),
newProduct("overwrites")(() => Slot),
]);
// A Value is either:
// - a literal, without any dependencies.
// - read from a slot. the Value then has a read-dependency on that slot.
// - a transformation of another Value, by a function. the function is also a Value.
const variants = [
newProduct("literal", () => Dynamic),
newProduct("read", () => Slot),
newProduct("transformation", () => prodType(Value, Dynamic)),
];
const Value = enumType(variants);
// console.log(prettyT(Slot));
// console.log(prettyT(Value));