git.iko.soy/rowtype-yoga/purescript-backend-optimizer
on main help sign in
22 lines 720 B history raw
1import * as Data$dShow from "../Data.Show/index.js";
2import * as Partial from "../Partial/index.js";
3const test3 = {type: "foo", value: 42};
4const test2 = x => r => {
5 if (r.type === "foo") { return Data$dShow.showIntImpl(r.value); }
6 if (r.type === "bar") {
7 if (r.value) { return "true"; }
8 return "false";
9 }
10 if (r.type === "baz") { return r.value; }
11 return x(r);
12};
13const test1 = r => {
14 if (r.type === "baz") { return r.value; }
15 if (r.type === "bar") {
16 if (r.value) { return "true"; }
17 return "false";
18 }
19 if (r.type === "foo") { return Data$dShow.showIntImpl(r.value); }
20 return Partial._crashWith("Data.Variant: pattern match failure [" + r.type + "]");
21};
22export {test1, test2, test3};