index.ts FAILURE!!!!

This commit is contained in:
Umur Ozkul 2022-04-25 09:20:27 +02:00
parent c5e08cfdb6
commit 6a87e8db28

View File

@ -81,10 +81,13 @@ function tag<a, b>(x: a, y: b): tagged<a, b> {
return { tag: x, value: y }; return { tag: x, value: y };
} }
export abstract class internalCode { protected opaque!: any }; /* simulate opaque types */
export type squiggleExpression = export type squiggleExpression =
| tagged<"symbol", string> | tagged<"symbol", string>
| tagged<"string", string> | tagged<"string", string>
| tagged<"call", string> | tagged<"call", string>
| tagged<"lambda", [string[], internalCode]>
| tagged<"array", squiggleExpression[]> | tagged<"array", squiggleExpression[]>
| tagged<"boolean", boolean> | tagged<"boolean", boolean>
| tagged<"distribution", Distribution> | tagged<"distribution", Distribution>
@ -115,6 +118,8 @@ function createTsExport(
return tag("boolean", x.value); return tag("boolean", x.value);
case "EvCall": case "EvCall":
return tag("call", x.value); return tag("call", x.value);
case "EvLambda":
return tag("lambda", x.value);
case "EvDistribution": case "EvDistribution":
return tag("distribution", new Distribution(x.value, sampEnv)); return tag("distribution", new Distribution(x.value, sampEnv));
case "EvNumber": case "EvNumber":