-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.ts
31 lines (29 loc) · 991 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { newTypeVar, Substitution } from "./helper";
import { M } from "./m";
import { makeContext, MonoType } from "./models";
import { parse } from "./parser";
import { W } from "./w";
const type = newTypeVar();
console.dir(W(
makeContext({
'not': { type: 'ty-app', C: '->', mus: [
{ type: 'ty-app', C: 'Bool', mus: [] },
{ type: 'ty-app', C: 'Bool', mus: [] },
] },
'odd': { type: 'ty-app', C: '->', mus: [
{ type: 'ty-app', C: 'Int', mus: [] },
{ type: 'ty-app', C: 'Bool', mus: [] },
] },
'add': { type: 'ty-app', C: '->', mus: [
{ type: 'ty-app', C: 'Int', mus: [] },
{ type: 'ty-app', C: '->', mus: [
{ type: 'ty-app', C: 'Int', mus: [] },
{ type: 'ty-app', C: 'Int', mus: [] },
] },
] },
'true': { type: 'ty-app', C: 'Bool', mus: [] },
'false': { type: 'ty-app', C: 'Bool', mus: [] },
'one': { type: 'ty-app', C: 'Int', mus: [] },
}),
parse('odd one'),
)[1], { depth: Infinity });