-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathUncurriedAlways.js
235 lines (183 loc) · 3.35 KB
/
UncurriedAlways.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
function foo(x, y) {
return x + y | 0;
}
let z = 7;
function bar(x, y) {
return x + y | 0;
}
let b = 7;
let w = 7;
let a = 7;
console.log(a);
[1].map(function (x) {
return x + 1 | 0;
});
function ptl(extra) {
return 10 + extra | 0;
}
function foo2(x, y) {
return x + y | 0;
}
function bar2(__x) {
return __x + 3 | 0;
}
function foo3(x, y, z) {
return (x + y | 0) + z | 0;
}
function bar3(__x) {
return foo3(__x, 3, 4);
}
function q(param) {
return null;
}
function inl() {
}
function inl2(x, y) {
return x + y | 0;
}
function foo$1(x, y, z) {
return [
x,
y,
z
];
}
function ptl$1(none, extra) {
return [
none,
"y",
extra
];
}
let a1 = ptl$1("x", "z");
console.log("a1:", a1);
let AllLabels = {
foo: foo$1,
ptl: ptl$1,
a1: a1
};
function foo$2(x, y, z, dOpt) {
let d = dOpt !== undefined ? dOpt : "d=0";
return [
x,
y,
z,
d
];
}
function ptl$2(none, extra, extra$1) {
return foo$2(none, "y", extra, extra$1);
}
let b1 = ptl$2("x", "z", undefined);
console.log("b1:", b1);
let b2 = ptl$2("x", "z", "d<-100");
console.log("b2:", b2);
let OptAtEnd = {
foo: foo$2,
ptl: ptl$2,
b1: b1,
b2: b2
};
function foo$3(d1Opt, x, d2Opt, y, d3Opt, z, d4Opt, w, d5Opt) {
let d1 = d1Opt !== undefined ? d1Opt : "d1=0";
let d2 = d2Opt !== undefined ? d2Opt : "d2=0";
let d3 = d3Opt !== undefined ? d3Opt : "d3=0";
let d4 = d4Opt !== undefined ? d4Opt : "d4=0";
let d5 = d5Opt !== undefined ? d5Opt : "d5=0";
return [
d1,
x,
d2,
y,
d3,
z,
d4,
w,
d5
];
}
function ptl$3(none, none$1, none$2, none$3, none$4, none$5, extra) {
return foo$3(none, none$1, none$2, "y", none$3, none$4, none$5, "w", extra);
}
let c1 = ptl$3(undefined, "x", undefined, undefined, "z", undefined, undefined);
console.log("c1:", c1);
let c2 = ptl$3("d1<-100", "x", undefined, undefined, "z", undefined, undefined);
console.log("c2:", c2);
let c3 = ptl$3(undefined, "x", "d2<-200", undefined, "z", "d4<-400", undefined);
console.log("c3:", c3);
let OptMixed = {
foo: foo$3,
ptl: ptl$3,
c1: c1,
c2: c2,
c3: c3
};
function fn(cb) {
return cb();
}
((function (s) {
console.log({
NAME: "foo",
VAL: s
});
})());
function fn1(a, b, param) {
return a() + b | 0;
}
function a$1(__x) {
return fn1((function () {
return 1;
}), 2, __x);
}
function f3(x, y, z) {
console.log(x);
return (x + y | 0) + z | 0;
}
function fx(extra, extra$1) {
return f3(1, extra, extra$1);
}
function fy(none, extra) {
return f3(none, 1, extra);
}
function fz(none, none$1) {
return f3(none, none$1, 1);
}
let fxyz = f3(1, 1, 1);
let PartialApplication = {
f3: f3,
fx: fx,
fy: fy,
fz: fz,
fxyz: fxyz
};
function hello1(y, f) {
return f(y);
}
function hello2(y, f) {
return f(y);
}
exports.foo = foo;
exports.z = z;
exports.bar = bar;
exports.b = b;
exports.w = w;
exports.ptl = ptl;
exports.foo2 = foo2;
exports.bar2 = bar2;
exports.foo3 = foo3;
exports.bar3 = bar3;
exports.q = q;
exports.inl = inl;
exports.inl2 = inl2;
exports.AllLabels = AllLabels;
exports.OptAtEnd = OptAtEnd;
exports.OptMixed = OptMixed;
exports.fn = fn;
exports.fn1 = fn1;
exports.a = a$1;
exports.PartialApplication = PartialApplication;
exports.hello1 = hello1;
exports.hello2 = hello2;
/* Not a pure module */