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

View file

@ -8,8 +8,8 @@ import { typedFnType } from "./types.js";
import { makeGeneric } from "../generics/generics.js";
import { sumType } from "./types.js";
export const constructorLeft = left => ({t: "L", v: left }); // 't': tag, 'v': value
export const constructorRight = right => ({t: "R", v: right});
export const newLeft = left => ({t: "L", v: left }); // 't': tag, 'v': value
export const newRight = right => ({t: "R", v: right});
// signature:
// sum-type -> (leftType -> resultType, rightType -> resultType) -> resultType
@ -31,7 +31,7 @@ export const ModuleSum = {l:[
),
// a -> a | b
...typedFnType(constructorLeft, fnType =>
...typedFnType(newLeft, fnType =>
makeGeneric((a, b) =>
fnType
(a)
@ -39,7 +39,7 @@ export const ModuleSum = {l:[
), GenericType),
// b -> a | b
...typedFnType(constructorRight, fnType =>
...typedFnType(newRight, fnType =>
makeGeneric((a, b) =>
fnType
(b)