17 lines
357 B
Text
17 lines
357 B
Text
open Jest
|
|
open Belt
|
|
open Data
|
|
open Bidir
|
|
|
|
open Expect
|
|
open! Expect.Operators
|
|
|
|
let mapFirst = a => a->Result.map(((x, _)) => x)
|
|
|
|
test("id", () => {
|
|
let id: term = Lam("x", Var("x"))
|
|
let ctx = list{}
|
|
let typ = synthesize(ctx, id)->mapFirst
|
|
Js.Console.error2("output: ", typ)
|
|
expect(typ) === Ok(TPolytype("ex0", TArrow(TVar("ex0"), TVar("ex0"))))
|
|
})
|