git.iko.soy/rowtype-yoga/yoga-r3f
on main help sign in
356 lines 11 kB history raw
1// Generated by purs version 0.15.16
2import * as Control_Alt from "../Control.Alt/index.js";
3import * as Control_Apply from "../Control.Apply/index.js";
4import * as Data_Bounded from "../Data.Bounded/index.js";
5import * as Data_Eq from "../Data.Eq/index.js";
6import * as Data_Function from "../Data.Function/index.js";
7import * as Data_Functor from "../Data.Functor/index.js";
8import * as Data_Functor_Invariant from "../Data.Functor.Invariant/index.js";
9import * as Data_Generic_Rep from "../Data.Generic.Rep/index.js";
10import * as Data_Maybe from "../Data.Maybe/index.js";
11import * as Data_Ord from "../Data.Ord/index.js";
12import * as Data_Ordering from "../Data.Ordering/index.js";
13import * as Data_Semigroup from "../Data.Semigroup/index.js";
14import * as Data_Show from "../Data.Show/index.js";
15import * as Data_Unit from "../Data.Unit/index.js";
16var Left = /* #__PURE__ */ (function () {
17 function Left(value0) {
18 this.value0 = value0;
19 };
20 Left.create = function (value0) {
21 return new Left(value0);
22 };
23 return Left;
24})();
25var Right = /* #__PURE__ */ (function () {
26 function Right(value0) {
27 this.value0 = value0;
28 };
29 Right.create = function (value0) {
30 return new Right(value0);
31 };
32 return Right;
33})();
34var showEither = function (dictShow) {
35 var show = Data_Show.show(dictShow);
36 return function (dictShow1) {
37 var show1 = Data_Show.show(dictShow1);
38 return {
39 show: function (v) {
40 if (v instanceof Left) {
41 return "(Left " + (show(v.value0) + ")");
42 };
43 if (v instanceof Right) {
44 return "(Right " + (show1(v.value0) + ")");
45 };
46 throw new Error("Failed pattern match at Data.Either (line 173, column 1 - line 175, column 46): " + [ v.constructor.name ]);
47 }
48 };
49 };
50};
51var note$prime = function (f) {
52 return Data_Maybe["maybe$prime"](function ($138) {
53 return Left.create(f($138));
54 })(Right.create);
55};
56var note = function (a) {
57 return Data_Maybe.maybe(new Left(a))(Right.create);
58};
59var genericEither = {
60 to: function (x) {
61 if (x instanceof Data_Generic_Rep.Inl) {
62 return new Left(x.value0);
63 };
64 if (x instanceof Data_Generic_Rep.Inr) {
65 return new Right(x.value0);
66 };
67 throw new Error("Failed pattern match at Data.Either (line 33, column 1 - line 33, column 56): " + [ x.constructor.name ]);
68 },
69 from: function (x) {
70 if (x instanceof Left) {
71 return new Data_Generic_Rep.Inl(x.value0);
72 };
73 if (x instanceof Right) {
74 return new Data_Generic_Rep.Inr(x.value0);
75 };
76 throw new Error("Failed pattern match at Data.Either (line 33, column 1 - line 33, column 56): " + [ x.constructor.name ]);
77 }
78};
79var functorEither = {
80 map: function (f) {
81 return function (m) {
82 if (m instanceof Left) {
83 return new Left(m.value0);
84 };
85 if (m instanceof Right) {
86 return new Right(f(m.value0));
87 };
88 throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): " + [ m.constructor.name ]);
89 };
90 }
91};
92var map = /* #__PURE__ */ Data_Functor.map(functorEither);
93var invariantEither = {
94 imap: /* #__PURE__ */ Data_Functor_Invariant.imapF(functorEither)
95};
96var fromRight$prime = function (v) {
97 return function (v1) {
98 if (v1 instanceof Right) {
99 return v1.value0;
100 };
101 return v(Data_Unit.unit);
102 };
103};
104var fromRight = function (v) {
105 return function (v1) {
106 if (v1 instanceof Right) {
107 return v1.value0;
108 };
109 return v;
110 };
111};
112var fromLeft$prime = function (v) {
113 return function (v1) {
114 if (v1 instanceof Left) {
115 return v1.value0;
116 };
117 return v(Data_Unit.unit);
118 };
119};
120var fromLeft = function (v) {
121 return function (v1) {
122 if (v1 instanceof Left) {
123 return v1.value0;
124 };
125 return v;
126 };
127};
128var extendEither = {
129 extend: function (v) {
130 return function (v1) {
131 if (v1 instanceof Left) {
132 return new Left(v1.value0);
133 };
134 return new Right(v(v1));
135 };
136 },
137 Functor0: function () {
138 return functorEither;
139 }
140};
141var eqEither = function (dictEq) {
142 var eq = Data_Eq.eq(dictEq);
143 return function (dictEq1) {
144 var eq1 = Data_Eq.eq(dictEq1);
145 return {
146 eq: function (x) {
147 return function (y) {
148 if (x instanceof Left && y instanceof Left) {
149 return eq(x.value0)(y.value0);
150 };
151 if (x instanceof Right && y instanceof Right) {
152 return eq1(x.value0)(y.value0);
153 };
154 return false;
155 };
156 }
157 };
158 };
159};
160var ordEither = function (dictOrd) {
161 var compare = Data_Ord.compare(dictOrd);
162 var eqEither1 = eqEither(dictOrd.Eq0());
163 return function (dictOrd1) {
164 var compare1 = Data_Ord.compare(dictOrd1);
165 var eqEither2 = eqEither1(dictOrd1.Eq0());
166 return {
167 compare: function (x) {
168 return function (y) {
169 if (x instanceof Left && y instanceof Left) {
170 return compare(x.value0)(y.value0);
171 };
172 if (x instanceof Left) {
173 return Data_Ordering.LT.value;
174 };
175 if (y instanceof Left) {
176 return Data_Ordering.GT.value;
177 };
178 if (x instanceof Right && y instanceof Right) {
179 return compare1(x.value0)(y.value0);
180 };
181 throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): " + [ x.constructor.name, y.constructor.name ]);
182 };
183 },
184 Eq0: function () {
185 return eqEither2;
186 }
187 };
188 };
189};
190var eq1Either = function (dictEq) {
191 var eqEither1 = eqEither(dictEq);
192 return {
193 eq1: function (dictEq1) {
194 return Data_Eq.eq(eqEither1(dictEq1));
195 }
196 };
197};
198var ord1Either = function (dictOrd) {
199 var ordEither1 = ordEither(dictOrd);
200 var eq1Either1 = eq1Either(dictOrd.Eq0());
201 return {
202 compare1: function (dictOrd1) {
203 return Data_Ord.compare(ordEither1(dictOrd1));
204 },
205 Eq10: function () {
206 return eq1Either1;
207 }
208 };
209};
210var either = function (v) {
211 return function (v1) {
212 return function (v2) {
213 if (v2 instanceof Left) {
214 return v(v2.value0);
215 };
216 if (v2 instanceof Right) {
217 return v1(v2.value0);
218 };
219 throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): " + [ v.constructor.name, v1.constructor.name, v2.constructor.name ]);
220 };
221 };
222};
223var hush = /* #__PURE__ */ (function () {
224 return either(Data_Function["const"](Data_Maybe.Nothing.value))(Data_Maybe.Just.create);
225})();
226var isLeft = /* #__PURE__ */ either(/* #__PURE__ */ Data_Function["const"](true))(/* #__PURE__ */ Data_Function["const"](false));
227var isRight = /* #__PURE__ */ either(/* #__PURE__ */ Data_Function["const"](false))(/* #__PURE__ */ Data_Function["const"](true));
228var choose = function (dictAlt) {
229 var alt = Control_Alt.alt(dictAlt);
230 var map1 = Data_Functor.map(dictAlt.Functor0());
231 return function (a) {
232 return function (b) {
233 return alt(map1(Left.create)(a))(map1(Right.create)(b));
234 };
235 };
236};
237var boundedEither = function (dictBounded) {
238 var bottom = Data_Bounded.bottom(dictBounded);
239 var ordEither1 = ordEither(dictBounded.Ord0());
240 return function (dictBounded1) {
241 var ordEither2 = ordEither1(dictBounded1.Ord0());
242 return {
243 top: new Right(Data_Bounded.top(dictBounded1)),
244 bottom: new Left(bottom),
245 Ord0: function () {
246 return ordEither2;
247 }
248 };
249 };
250};
251var blush = /* #__PURE__ */ (function () {
252 return either(Data_Maybe.Just.create)(Data_Function["const"](Data_Maybe.Nothing.value));
253})();
254var applyEither = {
255 apply: function (v) {
256 return function (v1) {
257 if (v instanceof Left) {
258 return new Left(v.value0);
259 };
260 if (v instanceof Right) {
261 return map(v.value0)(v1);
262 };
263 throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): " + [ v.constructor.name, v1.constructor.name ]);
264 };
265 },
266 Functor0: function () {
267 return functorEither;
268 }
269};
270var apply = /* #__PURE__ */ Control_Apply.apply(applyEither);
271var bindEither = {
272 bind: /* #__PURE__ */ either(function (e) {
273 return function (v) {
274 return new Left(e);
275 };
276 })(function (a) {
277 return function (f) {
278 return f(a);
279 };
280 }),
281 Apply0: function () {
282 return applyEither;
283 }
284};
285var semigroupEither = function (dictSemigroup) {
286 var append1 = Data_Semigroup.append(dictSemigroup);
287 return {
288 append: function (x) {
289 return function (y) {
290 return apply(map(append1)(x))(y);
291 };
292 }
293 };
294};
295var applicativeEither = /* #__PURE__ */ (function () {
296 return {
297 pure: Right.create,
298 Apply0: function () {
299 return applyEither;
300 }
301 };
302})();
303var monadEither = {
304 Applicative0: function () {
305 return applicativeEither;
306 },
307 Bind1: function () {
308 return bindEither;
309 }
310};
311var altEither = {
312 alt: function (v) {
313 return function (v1) {
314 if (v instanceof Left) {
315 return v1;
316 };
317 return v;
318 };
319 },
320 Functor0: function () {
321 return functorEither;
322 }
323};
324export {
325 Left,
326 Right,
327 either,
328 choose,
329 isLeft,
330 isRight,
331 fromLeft,
332 fromLeft$prime,
333 fromRight,
334 fromRight$prime,
335 note,
336 note$prime,
337 hush,
338 blush,
339 functorEither,
340 genericEither,
341 invariantEither,
342 applyEither,
343 applicativeEither,
344 altEither,
345 bindEither,
346 monadEither,
347 extendEither,
348 showEither,
349 eqEither,
350 eq1Either,
351 ordEither,
352 ord1Either,
353 boundedEither,
354 semigroupEither
355};
356//# sourceMappingURL=index.js.map