-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathSnapshot.KnownConstructors06.js
39 lines (39 loc) · 1.56 KB
/
Snapshot.KnownConstructors06.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
// @inline Data.Show.Generic.genericShowConstructor arity=2
// @inline export genericTest.from arity=1
import * as $runtime from "../runtime.js";
import * as Data$dGeneric$dRep from "../Data.Generic.Rep/index.js";
const $Test = tag => tag;
const Foo = /* #__PURE__ */ $Test("Foo");
const Bar = /* #__PURE__ */ $Test("Bar");
const Baz = /* #__PURE__ */ $Test("Baz");
const Qux = /* #__PURE__ */ $Test("Qux");
const genericTest = {
to: x => {
if (x.tag === "Inl") { return Foo; }
if (x.tag === "Inr") {
if (x._1.tag === "Inl") { return Bar; }
if (x._1.tag === "Inr") {
if (x._1._1.tag === "Inl") { return Baz; }
if (x._1._1.tag === "Inr") { return Qux; }
}
}
$runtime.fail();
},
from: x => {
if (x === "Foo") { return Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.NoArguments); }
if (x === "Bar") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.NoArguments)); }
if (x === "Baz") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inl", Data$dGeneric$dRep.NoArguments))); }
if (x === "Qux") { return Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.$Sum("Inr", Data$dGeneric$dRep.NoArguments))); }
$runtime.fail();
}
};
const showTest = {
show: x => {
if (x === "Foo") { return "Foo"; }
if (x === "Bar") { return "Bar"; }
if (x === "Baz") { return "Baz"; }
if (x === "Qux") { return "Qux"; }
$runtime.fail();
}
};
export {$Test, Bar, Baz, Foo, Qux, genericTest, showTest};