interactive prompt can handle polymorphic types

This commit is contained in:
Joeri Exelmans 2025-04-02 15:49:43 +02:00
parent a0e3aa0cb3
commit 4a4983f693
20 changed files with 485 additions and 276 deletions

View file

@ -3,20 +3,17 @@ import { Bool, SymbolT, Type } from "../primitives/types.js";
import { String } from "../structures/list.js";
import { typedFnType } from "../structures/types.js";
// The way instances of SymbolT are currently encoded, their constructor is not a valid DOPE function, because it is impure.
// The only way to construct symbols is to do it in JS code.
export const ModuleSymbol = {l:[
{i: SymbolT, t: Type},
// ...typedFnType(constructSymbol, fnType =>
// fnType
// (String)
// (SymbolT)
// ),
...typedFnType(getName, fnType =>
fnType
(SymbolT)
(String)
),
...typedFnType(eqSymbol, fnType => fnType(SymbolT, fnType(SymbolT, Bool))),
...typedFnType(eqSymbol, fnType => fnType(SymbolT)(fnType(SymbolT)(Bool))),
]};