recursive types (and operations on them, like pretty-printing, comparison and unification) seem to be working.
big part of the code base still needs to be 'ported' to the updated type constructors.
This commit is contained in:
parent
55c5d7cffa
commit
8eec5b9239
34 changed files with 523 additions and 295 deletions
|
|
@ -1,11 +1,7 @@
|
|||
import { fnType } from "../structures/types.js";
|
||||
import { deepEqual } from "../util/util.js";
|
||||
import { inspect } from "node:util";
|
||||
|
||||
// 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.
|
||||
|
||||
// a -> Value<a>
|
||||
export const newLiteral = val => ({
|
||||
kind: "literal",
|
||||
|
|
@ -44,7 +40,7 @@ export const transform = input => fn => {
|
|||
}
|
||||
};
|
||||
|
||||
// Value<a> -> Set<Slot<Any>>
|
||||
// Value<a> -> Set<Slot<Top>>
|
||||
export const getReadDependencies = value => {
|
||||
if (value.kind === "literal") {
|
||||
return new Set();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue