ID2WJIDOVGFNLXEJQAEHCKZ425N2FOB6TO2MVMW475MYNR2ONE2QC | TypeVar(string) // Ω,α| TermAnnot(string, typ) // Ω,x:A| ExistentialSolved(string, monotyp) // Ω,â=τ| Marker(string) // Ω,🢒â
| CCTypeVar(string) // Ω,α| CCTermAnnot(string, typ) // Ω,x:A| CCExistentialSolved(string, monotyp) // Ω,â=τ| CCMarker(string) // Ω,🢒â
| Unit => Unit| Var(x) => Var(x)| Existential(_) => failwith("TODO")| Polytype(_) => failwith("TODO")| Arrow(a, b) => Arrow(applyContext(ctx, a), applyContext(ctx, b))
| TUnit => TUnit| TVar(x) => TVar(x)| TExistential(_) => failwith("TODO")| TPolytype(_) => failwith("TODO")| TArrow(a, b) => TArrow(applyContext(ctx, a), applyContext(ctx, b))
{"verbose": true,"moduleFileExtensions": ["js", "mjs"],"extensionsToTreatAsEsm": [".bs.mjs"],"testMatch": ["**/__tests__/**/*_test.mjs", "**/__tests__/**/*_test.bs.js"],"transform": {"^.+.m?js$": "babel-jest"},"transformIgnorePatterns": ["node_modules/(?!(rescript)/)"]}
= Expressions- $ id : forall a. a arrow.r a $
module.exports = {presets: [["@babel/preset-env",{ targets: { node: "current", esmodules: false }, modules: "cjs" },],],plugins: [],};
open Jestopen Beltopen Dataopen Bidiropen Expectopen! Expect.Operatorslet mapFirst = a => a->Result.map(((x, _)) => x)test("id", () => {let id: term = Lam("x", Var("x"))let ctx = list{}let typ = synthesize(ctx, id)->mapFirstJs.Console.error2("output: ", typ)expect(typ) === Ok(TPolytype("ex0", TArrow(TVar("ex0"), TVar("ex0"))))})