forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arity_infer.js
58 lines (52 loc) · 1.08 KB
/
arity_infer.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict';
var Curry = require("../../lib/js/curry.js");
var Caml_builtin_exceptions = require("../../lib/js/caml_builtin_exceptions.js");
function f0(x) {
var tmp;
if (x > 3) {
tmp = (function (x) {
return x + 1 | 0;
});
} else {
throw Caml_builtin_exceptions.not_found;
}
return tmp(3);
}
function f1(x) {
throw Caml_builtin_exceptions.not_found;
return Curry._1(undefined, x);
}
function f3(x) {
var tmp;
if (x > 3 || x < 0) {
throw Caml_builtin_exceptions.not_found;
} else {
switch (x) {
case 0 :
tmp = (function (x) {
return x + 1 | 0;
});
break;
case 1 :
tmp = (function (x) {
return x + 2 | 0;
});
break;
case 2 :
tmp = (function (x) {
return x + 3 | 0;
});
break;
case 3 :
tmp = (function (x) {
return x + 4 | 0;
});
break;
}
}
return tmp(3);
}
exports.f0 = f0;
exports.f1 = f1;
exports.f3 = f3;
/* No side effect */