Skip to content

Add inline annotations for some more core libs #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions backend-es/test/snapshots-out/Snapshot.Comparison01.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import * as $runtime from "../runtime.js";
import * as Data$dComparison from "../Data.Comparison/index.js";
import * as Data$dOrd from "../Data.Ord/index.js";
import * as Data$dOrdering from "../Data.Ordering/index.js";
import * as Data$dTuple from "../Data.Tuple/index.js";
const defaultComparison1 = /* #__PURE__ */ (() => Data$dOrd.ordRecord()((() => {
const eqRowCons2 = {eqRecord: v => ra => rb => ra.foo === rb.foo};
return {
compareRecord: v => ra => rb => {
const left = Data$dOrd.ordInt.compare(ra.foo)(rb.foo);
if (left.tag === "LT" || (left.tag === "GT" || !(left.tag === "EQ"))) { return left; }
return Data$dOrdering.EQ;
},
EqRecord0: () => eqRowCons2
};
})()).compare)();
const test8 = /* #__PURE__ */ (() => Data$dComparison.monoidComparison.mempty)();
const test7 = /* #__PURE__ */ (() => {
const defCom = Data$dTuple.ordTuple(Data$dOrd.ordInt)(Data$dTuple.ordTuple(Data$dOrd.ordString)(Data$dOrd.ordBoolean)).compare;
return Data$dComparison.semigroupComparison.append(x => y => defCom(x._1)(y._1))(Data$dComparison.semigroupComparison.append(x => y => defCom(x._2._1)(y._2._1))(x => y => defCom(x._2._2)(y._2._2)));
})();
const test6 = x => y => Data$dOrd.ordInt.compare(x.foo)(y.foo);
const test5 = /* #__PURE__ */ (() => Data$dOrd.ordInt.compare)();
const test4 = /* #__PURE__ */ (() => Data$dComparison.monoidComparison.mempty)();
const test3 = /* #__PURE__ */ (() => {
const defCom = Data$dOrd.ordRecord()((() => {
const eqRowCons2 = {eqRecord: v => ra => rb => ra.bar === rb.bar && (ra.baz === rb.baz && ra.foo === rb.foo)};
return {
compareRecord: v => ra => rb => {
const left = Data$dOrd.ordString.compare(ra.bar)(rb.bar);
if (left.tag === "LT" || (left.tag === "GT" || !(left.tag === "EQ"))) { return left; }
const left$1 = Data$dOrd.ordBoolean.compare(ra.baz)(rb.baz);
if (left$1.tag === "LT" || (left$1.tag === "GT" || !(left$1.tag === "EQ"))) { return left$1; }
const left$2 = Data$dOrd.ordInt.compare(ra.foo)(rb.foo);
if (left$2.tag === "LT" || (left$2.tag === "GT" || !(left$2.tag === "EQ"))) { return left$2; }
return Data$dOrdering.EQ;
},
EqRecord0: () => eqRowCons2
};
})()).compare;
return Data$dComparison.semigroupComparison.append(x => y => defCom(x.foo)(y.foo))(Data$dComparison.semigroupComparison.append(x => y => defCom(x.bar)(y.bar))(x => y => defCom(x.baz)(y.baz)));
})();
const test2 = x => y => defaultComparison1(x.foo)(y.foo);
const test1 = defaultComparison1;
export {defaultComparison1, test1, test2, test3, test4, test5, test6, test7, test8};
25 changes: 25 additions & 0 deletions backend-es/test/snapshots-out/Snapshot.Const01.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as $runtime from "../runtime.js";
import * as Data$dEuclideanRing from "../Data.EuclideanRing/index.js";
import * as Data$dOrd from "../Data.Ord/index.js";
const test9 = "";
const test8 = "hi";
const test7 = "h";
const test6 = -2147483648;
const test5 = 2147483647;
const test4 = /* #__PURE__ */ (() => Data$dOrd.ordString.compare("h")("i"))();
const test3 = true;
const test21 = "";
const test20 = "hi";
const test2 = false;
const test19 = 1;
const test18 = false;
const test17 = true;
const test16 = /* #__PURE__ */ Data$dEuclideanRing.intMod(2)(2);
const test15 = /* #__PURE__ */ Data$dEuclideanRing.intDiv(1)(1);
const test14 = 1;
const test13 = 0;
const test12 = 1;
const test11 = 0;
const test10 = 2;
const test1 = false;
export {test1, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test2, test20, test21, test3, test4, test5, test6, test7, test8, test9};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as $runtime from "../runtime.js";
import * as Data$dTuple from "../Data.Tuple/index.js";
const test4 = /* #__PURE__ */ Data$dTuple.$Tuple(6, "hello world");
const test3 = /* #__PURE__ */ Data$dTuple.$Tuple(3, "hello world");
const test2 = /* #__PURE__ */ Data$dTuple.$Tuple("b", 2);
const test1 = /* #__PURE__ */ Data$dTuple.$Tuple("a", 1);
export {test1, test2, test3, test4};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as $runtime from "../runtime.js";
import * as Data$dTuple from "../Data.Tuple/index.js";
const test2 = /* #__PURE__ */ Data$dTuple.$Tuple(true, "1");
const test1 = /* #__PURE__ */ Data$dTuple.$Tuple("true", 1);
export {test1, test2};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as $runtime from "../runtime.js";
const test4 = x => x + 5 | 0;
const test3 = x => x + 4 | 0;
const test2 = 1;
const test1 = 1;
export {test1, test2, test3, test4};
55 changes: 55 additions & 0 deletions backend-es/test/snapshots-out/Snapshot.GenericBounded01.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// @inline export genericTest1.to arity=1
import * as $runtime from "../runtime.js";
import * as Data$dGeneric$dRep from "../Data.Generic.Rep/index.js";
import * as Data$dOrdering from "../Data.Ordering/index.js";
const $Test1 = tag => ({tag});
const Bottom1 = /* #__PURE__ */ $Test1("Bottom1");
const Ignored1 = /* #__PURE__ */ $Test1("Ignored1");
const Top1 = /* #__PURE__ */ $Test1("Top1");
const eqTest1 = {
eq: x => y => {
if (x.tag === "Bottom1") { return y.tag === "Bottom1"; }
if (x.tag === "Ignored1") { return y.tag === "Ignored1"; }
if (x.tag === "Top1") { return y.tag === "Top1"; }
return false;
}
};
const ordTest1 = {
compare: x => y => {
if (x.tag === "Bottom1") {
if (y.tag === "Bottom1") { return Data$dOrdering.EQ; }
return Data$dOrdering.LT;
}
if (y.tag === "Bottom1") { return Data$dOrdering.GT; }
if (x.tag === "Ignored1") {
if (y.tag === "Ignored1") { return Data$dOrdering.EQ; }
return Data$dOrdering.LT;
}
if (y.tag === "Ignored1") { return Data$dOrdering.GT; }
if (x.tag === "Top1") {
if (y.tag === "Top1") { return Data$dOrdering.EQ; }
$runtime.fail();
}
$runtime.fail();
},
Eq0: () => eqTest1
};
const genericTest1 = {
to: x => {
if (x.tag === "Inl") { return Bottom1; }
if (x.tag === "Inr") {
if (x._1.tag === "Inl") { return Ignored1; }
if (x._1.tag === "Inr") { return Top1; }
$runtime.fail();
}
$runtime.fail();
},
from: x => {
if (x.tag === "Bottom1") { return Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.NoArguments); }
if (x.tag === "Ignored1") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.NoArguments)); }
if (x.tag === "Top1") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.NoArguments)); }
$runtime.fail();
}
};
const boundedTest1 = {bottom: Bottom1, top: Top1, Ord0: () => ordTest1};
export {$Test1, Bottom1, Ignored1, Top1, boundedTest1, eqTest1, genericTest1, ordTest1};
102 changes: 102 additions & 0 deletions backend-es/test/snapshots-out/Snapshot.GenericBounded02.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// @inline export genericTest2.to arity=1
import * as $runtime from "../runtime.js";
import * as Data$dGeneric$dRep from "../Data.Generic.Rep/index.js";
import * as Data$dOrd from "../Data.Ord/index.js";
import * as Data$dOrdering from "../Data.Ordering/index.js";
const $Test2 = (tag, _1, _2, _3) => ({tag, _1, _2, _3});
const Bottom2 = value0 => value1 => value2 => $Test2("Bottom2", value0, value1, value2);
const Ignored2 = value0 => value1 => value2 => $Test2("Ignored2", value0, value1, value2);
const Top2 = value0 => value1 => value2 => $Test2("Top2", value0, value1, value2);
const eqTest2 = {
eq: x => y => {
if (x.tag === "Bottom2") {
if (y.tag === "Bottom2") { return x._1 === y._1 && x._2 === y._2 && (x._3.a === y._3.a && x._3.b === y._3.b); }
return false;
}
if (x.tag === "Ignored2") {
if (y.tag === "Ignored2") { return x._1 === y._1 && x._2 === y._2 && (x._3.a === y._3.a && x._3.b === y._3.b); }
return false;
}
if (x.tag === "Top2") {
if (y.tag === "Top2") { return x._1 === y._1 && x._2 === y._2 && (x._3.a === y._3.a && x._3.b === y._3.b); }
return false;
}
return false;
}
};
const ordTest2 = {
compare: x => y => {
if (x.tag === "Bottom2") {
if (y.tag === "Bottom2") {
const v = Data$dOrd.ordInt.compare(x._1)(y._1);
if (v.tag === "LT") { return Data$dOrdering.LT; }
if (v.tag === "GT") { return Data$dOrdering.GT; }
const v1 = Data$dOrd.ordBoolean.compare(x._2)(y._2);
if (v1.tag === "LT") { return Data$dOrdering.LT; }
if (v1.tag === "GT") { return Data$dOrdering.GT; }
const v2 = Data$dOrd.ordInt.compare(x._3.a)(y._3.a);
if (v2.tag === "LT") { return Data$dOrdering.LT; }
if (v2.tag === "GT") { return Data$dOrdering.GT; }
return Data$dOrd.ordBoolean.compare(x._3.b)(y._3.b);
}
return Data$dOrdering.LT;
}
if (y.tag === "Bottom2") { return Data$dOrdering.GT; }
if (x.tag === "Ignored2") {
if (y.tag === "Ignored2") {
const v = Data$dOrd.ordInt.compare(x._1)(y._1);
if (v.tag === "LT") { return Data$dOrdering.LT; }
if (v.tag === "GT") { return Data$dOrdering.GT; }
const v1 = Data$dOrd.ordBoolean.compare(x._2)(y._2);
if (v1.tag === "LT") { return Data$dOrdering.LT; }
if (v1.tag === "GT") { return Data$dOrdering.GT; }
const v2 = Data$dOrd.ordInt.compare(x._3.a)(y._3.a);
if (v2.tag === "LT") { return Data$dOrdering.LT; }
if (v2.tag === "GT") { return Data$dOrdering.GT; }
return Data$dOrd.ordBoolean.compare(x._3.b)(y._3.b);
}
return Data$dOrdering.LT;
}
if (y.tag === "Ignored2") { return Data$dOrdering.GT; }
if (x.tag === "Top2") {
if (y.tag === "Top2") {
const v = Data$dOrd.ordInt.compare(x._1)(y._1);
if (v.tag === "LT") { return Data$dOrdering.LT; }
if (v.tag === "GT") { return Data$dOrdering.GT; }
const v1 = Data$dOrd.ordBoolean.compare(x._2)(y._2);
if (v1.tag === "LT") { return Data$dOrdering.LT; }
if (v1.tag === "GT") { return Data$dOrdering.GT; }
const v2 = Data$dOrd.ordInt.compare(x._3.a)(y._3.a);
if (v2.tag === "LT") { return Data$dOrdering.LT; }
if (v2.tag === "GT") { return Data$dOrdering.GT; }
return Data$dOrd.ordBoolean.compare(x._3.b)(y._3.b);
}
$runtime.fail();
}
$runtime.fail();
},
Eq0: () => eqTest2
};
const genericTest2 = {
to: x => {
if (x.tag === "Inl") { return $Test2("Bottom2", x._1._1, x._1._2._1, x._1._2._2); }
if (x.tag === "Inr") {
if (x._1.tag === "Inl") { return $Test2("Ignored2", x._1._1._1, x._1._1._2._1, x._1._1._2._2); }
if (x._1.tag === "Inr") { return $Test2("Top2", x._1._1._1, x._1._1._2._1, x._1._1._2._2); }
$runtime.fail();
}
$runtime.fail();
},
from: x => {
if (x.tag === "Bottom2") { return Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.$Product(x._1, Data$dGeneric$dRep.$Product(x._2, x._3))); }
if (x.tag === "Ignored2") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.$Product(x._1, Data$dGeneric$dRep.$Product(x._2, x._3)))); }
if (x.tag === "Top2") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Product(x._1, Data$dGeneric$dRep.$Product(x._2, x._3)))); }
$runtime.fail();
}
};
const boundedTest2 = {
bottom: /* #__PURE__ */ $Test2("Bottom2", -2147483648, false, {a: -2147483648, b: false}),
top: /* #__PURE__ */ $Test2("Top2", 2147483647, true, {a: 2147483647, b: true}),
Ord0: () => ordTest2
};
export {$Test2, Bottom2, Ignored2, Top2, boundedTest2, eqTest2, genericTest2, ordTest2};
75 changes: 75 additions & 0 deletions backend-es/test/snapshots-out/Snapshot.GenericBounded03.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// @inline export genericTest3.to arity=1
import * as $runtime from "../runtime.js";
import * as Data$dGeneric$dRep from "../Data.Generic.Rep/index.js";
import * as Data$dOrd from "../Data.Ord/index.js";
import * as Data$dOrdering from "../Data.Ordering/index.js";
import * as Snapshot$dGenericBounded01 from "../Snapshot.GenericBounded01/index.js";
import * as Snapshot$dGenericBounded02 from "../Snapshot.GenericBounded02/index.js";
const $Test3 = (_1, _2, _3, _4, _5) => ({tag: "Both3", _1, _2, _3, _4, _5});
const Both3 = value0 => value1 => value2 => value3 => value4 => $Test3(value0, value1, value2, value3, value4);
const eqTest3 = {
eq: x => y => x._1 === y._1 && x._2 === y._2 && (() => {
if (x._3.tag === "Bottom1") { return y._3.tag === "Bottom1"; }
if (x._3.tag === "Ignored1") { return y._3.tag === "Ignored1"; }
if (x._3.tag === "Top1") { return y._3.tag === "Top1"; }
return false;
})() && Snapshot$dGenericBounded02.eqTest2.eq(x._4)(y._4) && (
x._5.a === y._5.a && x._5.b === y._5.b && (() => {
if (x._5.c.tag === "Bottom1") { return y._5.c.tag === "Bottom1"; }
if (x._5.c.tag === "Ignored1") { return y._5.c.tag === "Ignored1"; }
if (x._5.c.tag === "Top1") { return y._5.c.tag === "Top1"; }
return false;
})() && Snapshot$dGenericBounded02.eqTest2.eq(x._5.d)(y._5.d)
)
};
const ordTest3 = {
compare: x => y => {
const v = Data$dOrd.ordInt.compare(x._1)(y._1);
if (v.tag === "LT") { return Data$dOrdering.LT; }
if (v.tag === "GT") { return Data$dOrdering.GT; }
const v1 = Data$dOrd.ordBoolean.compare(x._2)(y._2);
if (v1.tag === "LT") { return Data$dOrdering.LT; }
if (v1.tag === "GT") { return Data$dOrdering.GT; }
const v2 = Snapshot$dGenericBounded01.ordTest1.compare(x._3)(y._3);
if (v2.tag === "LT") { return Data$dOrdering.LT; }
if (v2.tag === "GT") { return Data$dOrdering.GT; }
const v3 = Snapshot$dGenericBounded02.ordTest2.compare(x._4)(y._4);
if (v3.tag === "LT") { return Data$dOrdering.LT; }
if (v3.tag === "GT") { return Data$dOrdering.GT; }
const v4 = Data$dOrd.ordInt.compare(x._5.a)(y._5.a);
if (v4.tag === "LT") { return Data$dOrdering.LT; }
if (v4.tag === "GT") { return Data$dOrdering.GT; }
const v5 = Data$dOrd.ordBoolean.compare(x._5.b)(y._5.b);
if (v5.tag === "LT") { return Data$dOrdering.LT; }
if (v5.tag === "GT") { return Data$dOrdering.GT; }
const v6 = Snapshot$dGenericBounded01.ordTest1.compare(x._5.c)(y._5.c);
if (v6.tag === "LT") { return Data$dOrdering.LT; }
if (v6.tag === "GT") { return Data$dOrdering.GT; }
return Snapshot$dGenericBounded02.ordTest2.compare(x._5.d)(y._5.d);
},
Eq0: () => eqTest3
};
const genericTest3 = {
to: x => $Test3(x._1, x._2._1, x._2._2._1, x._2._2._2._1, x._2._2._2._2),
from: x => Data$dGeneric$dRep.$Product(x._1, Data$dGeneric$dRep.$Product(x._2, Data$dGeneric$dRep.$Product(x._3, Data$dGeneric$dRep.$Product(x._4, x._5))))
};
const boundedTest3 = /* #__PURE__ */ (() => (
{
bottom: $Test3(
-2147483648,
false,
Snapshot$dGenericBounded01.Bottom1,
Snapshot$dGenericBounded02.boundedTest2.bottom,
{a: -2147483648, b: false, c: Snapshot$dGenericBounded01.Bottom1, d: Snapshot$dGenericBounded02.boundedTest2.bottom}
),
top: $Test3(
2147483647,
true,
Snapshot$dGenericBounded01.Top1,
Snapshot$dGenericBounded02.boundedTest2.top,
{a: 2147483647, b: true, c: Snapshot$dGenericBounded01.Top1, d: Snapshot$dGenericBounded02.boundedTest2.top}
),
Ord0: () => ordTest3
}
))();
export {$Test3, Both3, boundedTest3, eqTest3, genericTest3, ordTest3};
Loading