Skip to content

Commit 7de9851

Browse files
authored
Merge pull request #325 from gren-lang/push-kyypyuulpmxn
Add NO_SIDE_EFFECT annotation above F[2-9] and A[2-9] functions
2 parents 350c81f + 726fbe8 commit 7de9851

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

compiler/src/Generate/JavaScript/Functions.hs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,51 @@ function F(arity, fun, wrapper) {
2121
return wrapper;
2222
}
2323

24+
/* @__NO_SIDE_EFFECTS__ */
2425
function F2(fun) {
2526
return F(2, fun, function(a) { return function(b) { return fun(a,b); }; })
2627
}
28+
/* @__NO_SIDE_EFFECTS__ */
2729
function F3(fun) {
2830
return F(3, fun, function(a) {
2931
return function(b) { return function(c) { return fun(a, b, c); }; };
3032
});
3133
}
34+
/* @__NO_SIDE_EFFECTS__ */
3235
function F4(fun) {
3336
return F(4, fun, function(a) { return function(b) { return function(c) {
3437
return function(d) { return fun(a, b, c, d); }; }; };
3538
});
3639
}
40+
/* @__NO_SIDE_EFFECTS__ */
3741
function F5(fun) {
3842
return F(5, fun, function(a) { return function(b) { return function(c) {
3943
return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };
4044
});
4145
}
46+
/* @__NO_SIDE_EFFECTS__ */
4247
function F6(fun) {
4348
return F(6, fun, function(a) { return function(b) { return function(c) {
4449
return function(d) { return function(e) { return function(f) {
4550
return fun(a, b, c, d, e, f); }; }; }; }; };
4651
});
4752
}
53+
/* @__NO_SIDE_EFFECTS__ */
4854
function F7(fun) {
4955
return F(7, fun, function(a) { return function(b) { return function(c) {
5056
return function(d) { return function(e) { return function(f) {
5157
return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; };
5258
});
5359
}
60+
/* @__NO_SIDE_EFFECTS__ */
5461
function F8(fun) {
5562
return F(8, fun, function(a) { return function(b) { return function(c) {
5663
return function(d) { return function(e) { return function(f) {
5764
return function(g) { return function(h) {
5865
return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; };
5966
});
6067
}
68+
/* @__NO_SIDE_EFFECTS__ */
6169
function F9(fun) {
6270
return F(9, fun, function(a) { return function(b) { return function(c) {
6371
return function(d) { return function(e) { return function(f) {
@@ -66,27 +74,35 @@ function F9(fun) {
6674
});
6775
}
6876

77+
/* @__NO_SIDE_EFFECTS__ */
6978
function A2(fun, a, b) {
7079
return fun.a === 2 ? fun.f(a, b) : fun(a)(b);
7180
}
81+
/* @__NO_SIDE_EFFECTS__ */
7282
function A3(fun, a, b, c) {
7383
return fun.a === 3 ? fun.f(a, b, c) : fun(a)(b)(c);
7484
}
85+
/* @__NO_SIDE_EFFECTS__ */
7586
function A4(fun, a, b, c, d) {
7687
return fun.a === 4 ? fun.f(a, b, c, d) : fun(a)(b)(c)(d);
7788
}
89+
/* @__NO_SIDE_EFFECTS__ */
7890
function A5(fun, a, b, c, d, e) {
7991
return fun.a === 5 ? fun.f(a, b, c, d, e) : fun(a)(b)(c)(d)(e);
8092
}
93+
/* @__NO_SIDE_EFFECTS__ */
8194
function A6(fun, a, b, c, d, e, f) {
8295
return fun.a === 6 ? fun.f(a, b, c, d, e, f) : fun(a)(b)(c)(d)(e)(f);
8396
}
97+
/* @__NO_SIDE_EFFECTS__ */
8498
function A7(fun, a, b, c, d, e, f, g) {
8599
return fun.a === 7 ? fun.f(a, b, c, d, e, f, g) : fun(a)(b)(c)(d)(e)(f)(g);
86100
}
101+
/* @__NO_SIDE_EFFECTS__ */
87102
function A8(fun, a, b, c, d, e, f, g, h) {
88103
return fun.a === 8 ? fun.f(a, b, c, d, e, f, g, h) : fun(a)(b)(c)(d)(e)(f)(g)(h);
89104
}
105+
/* @__NO_SIDE_EFFECTS__ */
90106
function A9(fun, a, b, c, d, e, f, g, h, i) {
91107
return fun.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i);
92108
}

0 commit comments

Comments
 (0)