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) {
20 Left.create = function (value0) {
21 return new Left(value0);
25var Right = /* #__PURE__ */ (function () {
26 function Right(value0) {
29 Right.create = function (value0) {
30 return new Right(value0);
34var showEither = function (dictShow) {
35 var show = Data_Show.show(dictShow);
36 return function (dictShow1) {
37 var show1 = Data_Show.show(dictShow1);
40 if (v instanceof Left) {
41 return "(Left " + (show(v.value0) + ")");
43 if (v instanceof Right) {
44 return "(Right " + (show1(v.value0) + ")");
46 throw new Error("Failed pattern match at Data.Either (line 173, column 1 - line 175, column 46): " + [ v.constructor.name ]);
51var note$prime = function (f) {
52 return Data_Maybe["maybe$prime"](function ($138) {
53 return Left.create(f($138));
56var note = function (a) {
57 return Data_Maybe.maybe(new Left(a))(Right.create);
61 if (x instanceof Data_Generic_Rep.Inl) {
62 return new Left(x.value0);
64 if (x instanceof Data_Generic_Rep.Inr) {
65 return new Right(x.value0);
67 throw new Error("Failed pattern match at Data.Either (line 33, column 1 - line 33, column 56): " + [ x.constructor.name ]);
70 if (x instanceof Left) {
71 return new Data_Generic_Rep.Inl(x.value0);
73 if (x instanceof Right) {
74 return new Data_Generic_Rep.Inr(x.value0);
76 throw new Error("Failed pattern match at Data.Either (line 33, column 1 - line 33, column 56): " + [ x.constructor.name ]);
82 if (m instanceof Left) {
83 return new Left(m.value0);
85 if (m instanceof Right) {
86 return new Right(f(m.value0));
88 throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): " + [ m.constructor.name ]);
92var map = /* #__PURE__ */ Data_Functor.map(functorEither);
93var invariantEither = {
94 imap: /* #__PURE__ */ Data_Functor_Invariant.imapF(functorEither)
96var fromRight$prime = function (v) {
97 return function (v1) {
98 if (v1 instanceof Right) {
101 return v(Data_Unit.unit);
104var fromRight = function (v) {
105 return function (v1) {
106 if (v1 instanceof Right) {
112var fromLeft$prime = function (v) {
113 return function (v1) {
114 if (v1 instanceof Left) {
117 return v(Data_Unit.unit);
120var fromLeft = function (v) {
121 return function (v1) {
122 if (v1 instanceof Left) {
129 extend: function (v) {
130 return function (v1) {
131 if (v1 instanceof Left) {
132 return new Left(v1.value0);
134 return new Right(v(v1));
137 Functor0: function () {
138 return functorEither;
141var eqEither = function (dictEq) {
142 var eq = Data_Eq.eq(dictEq);
143 return function (dictEq1) {
144 var eq1 = Data_Eq.eq(dictEq1);
147 return function (y) {
148 if (x instanceof Left && y instanceof Left) {
149 return eq(x.value0)(y.value0);
151 if (x instanceof Right && y instanceof Right) {
152 return eq1(x.value0)(y.value0);
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());
167 compare: function (x) {
168 return function (y) {
169 if (x instanceof Left && y instanceof Left) {
170 return compare(x.value0)(y.value0);
172 if (x instanceof Left) {
173 return Data_Ordering.LT.value;
175 if (y instanceof Left) {
176 return Data_Ordering.GT.value;
178 if (x instanceof Right && y instanceof Right) {
179 return compare1(x.value0)(y.value0);
181 throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): " + [ x.constructor.name, y.constructor.name ]);
190var eq1Either = function (dictEq) {
191 var eqEither1 = eqEither(dictEq);
193 eq1: function (dictEq1) {
194 return Data_Eq.eq(eqEither1(dictEq1));
198var ord1Either = function (dictOrd) {
199 var ordEither1 = ordEither(dictOrd);
200 var eq1Either1 = eq1Either(dictOrd.Eq0());
202 compare1: function (dictOrd1) {
203 return Data_Ord.compare(ordEither1(dictOrd1));
210var either = function (v) {
211 return function (v1) {
212 return function (v2) {
213 if (v2 instanceof Left) {
216 if (v2 instanceof Right) {
217 return v1(v2.value0);
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 ]);
223var hush = /* #__PURE__ */ (function () {
224 return either(Data_Function["const"](Data_Maybe.Nothing.value))(Data_Maybe.Just.create);
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));
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());
243 top: new Right(Data_Bounded.top(dictBounded1)),
244 bottom: new Left(bottom),
251var blush = /* #__PURE__ */ (function () {
252 return either(Data_Maybe.Just.create)(Data_Function["const"](Data_Maybe.Nothing.value));
255 apply: function (v) {
256 return function (v1) {
257 if (v instanceof Left) {
258 return new Left(v.value0);
260 if (v instanceof Right) {
261 return map(v.value0)(v1);
263 throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): " + [ v.constructor.name, v1.constructor.name ]);
266 Functor0: function () {
267 return functorEither;
270var apply = /* #__PURE__ */ Control_Apply.apply(applyEither);
272 bind: /* #__PURE__ */ either(function (e) {
273 return function (v) {
277 return function (f) {
281 Apply0: function () {
285var semigroupEither = function (dictSemigroup) {
286 var append1 = Data_Semigroup.append(dictSemigroup);
288 append: function (x) {
289 return function (y) {
290 return apply(map(append1)(x))(y);
295var applicativeEither = /* #__PURE__ */ (function () {
298 Apply0: function () {
304 Applicative0: function () {
305 return applicativeEither;
313 return function (v1) {
314 if (v instanceof Left) {
320 Functor0: function () {
321 return functorEither;
356//# sourceMappingURL=index.js.map
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list