forked from aristanetworks/purescript-backend-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnapshot.Fusion01.js
37 lines (37 loc) · 1.42 KB
/
Snapshot.Fusion01.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
// @inline export overArray arity=1
import * as $runtime from "../runtime.js";
import * as Data$dArray from "../Data.Array/index.js";
import * as Data$dList from "../Data.List/index.js";
import * as Data$dList$dTypes from "../Data.List.Types/index.js";
import * as Data$dShow from "../Data.Show/index.js";
import * as Data$dString$dCodeUnits from "../Data.String.CodeUnits/index.js";
import * as Data$dUnfoldable from "../Data.Unfoldable/index.js";
const toUnfoldable = /* #__PURE__ */ Data$dList.toUnfoldable(Data$dUnfoldable.unfoldableArray);
const test = x => Data$dArray.reverse(toUnfoldable((() => {
const loop = loop$a0$copy => loop$a1$copy => {
let loop$a0 = loop$a0$copy, loop$a1 = loop$a1$copy, loop$c = true, loop$r;
while (loop$c) {
const n = loop$a0, acc = loop$a1;
if (n === 0) {
loop$c = false;
loop$r = acc;
continue;
}
loop$a0 = n - 1 | 0;
loop$a1 = (() => {
const v1 = Data$dString$dCodeUnits.stripPrefix("1")(Data$dShow.showIntImpl(1 + x[n] | 0));
if (v1.tag === "Just") {
const $5 = "2" + v1._1;
if ($5 !== "wat") { return Data$dList$dTypes.$List("Cons", $5 + "1", acc); }
return acc;
}
if (v1.tag === "Nothing") { return acc; }
$runtime.fail();
})();
continue;
};
return loop$r;
};
return loop(x.length - 1 | 0)(Data$dList$dTypes.Nil);
})()));
export {test, toUnfoldable};