Skip to content

Commit 3ae70af

Browse files
committed
1 parent f8f00d7 commit 3ae70af

10 files changed

+42
-42
lines changed

__tests__/Array_Test.res

+7-7
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ describe("findIndex", () => {
338338
})
339339

340340
describe("includes", () => {
341-
test("returns true if equal", () => expect(includes([1, 2, 3], 2, \"="))->toEqual(true))
342-
test("returns false if not equal", () => expect(includes([1, 5, 3], 2, \"="))->toEqual(false))
343-
test("returns false if empty", () => expect(includes([], 2, \"="))->toEqual(false))
341+
test("returns true if equal", () => expect(includes([1, 2, 3], 2, \"=="))->toEqual(true))
342+
test("returns false if not equal", () => expect(includes([1, 5, 3], 2, \"=="))->toEqual(false))
343+
test("returns false if empty", () => expect(includes([], 2, \"=="))->toEqual(false))
344344
})
345345

346346
describe("minimum", () => {
@@ -502,12 +502,12 @@ describe("slice", () => {
502502
test("works `from` >= `to_`", () => expect(slice(~start=4, ~end=3, numbers))->toEqual([]))
503503
})
504504
describe("fold", () => {
505-
test("works for an empty array", () => expect(fold([], ~f=\"^", ~initial=""))->toEqual(""))
505+
test("works for an empty array", () => expect(fold([], ~f=\"++", ~initial=""))->toEqual(""))
506506
test("works for an ascociative operator", () =>
507507
expect(fold(~f=\"*", ~initial=1, repeat(~length=4, 7)))->toEqual(2401)
508508
)
509509
test("works the order of arguments to `f` is important", () =>
510-
expect(fold(["a", "b", "c"], ~f=\"^", ~initial=""))->toEqual("abc")
510+
expect(fold(["a", "b", "c"], ~f=\"++", ~initial=""))->toEqual("abc")
511511
)
512512
test("works the order of arguments to `f` is important", () =>
513513
expect(
@@ -516,10 +516,10 @@ describe("fold", () => {
516516
)
517517
})
518518
describe("foldRight", () => {
519-
test("works for empty arrays", () => expect(foldRight([], ~f=\"^", ~initial=""))->toEqual(""))
519+
test("works for empty arrays", () => expect(foldRight([], ~f=\"++", ~initial=""))->toEqual(""))
520520
test("foldRight", () => expect(foldRight(~f=\"+", ~initial=0, repeat(~length=3, 5)))->toEqual(15))
521521
test("works the order of arguments to `f` is important", () =>
522-
expect(foldRight(["a", "b", "c"], ~f=\"^", ~initial=""))->toEqual("cba")
522+
expect(foldRight(["a", "b", "c"], ~f=\"++", ~initial=""))->toEqual("cba")
523523
)
524524
test("works the order of arguments to `f` is important", () =>
525525
expect(

__tests__/List_Test.res

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ describe("groupWhile", () => {
262262
test("empty list", () => expect(groupWhile(~f=String.equal, list{}))->toEqual(list{}))
263263

264264
test("normal char", () =>
265-
expect(groupWhile(~f=\"<>", list{"a", "b", "b", "a", "a", "a", "b", "a"}))->toEqual(list{
265+
expect(groupWhile(~f=\"!=", list{"a", "b", "b", "a", "a", "a", "b", "a"}))->toEqual(list{
266266
list{"a"},
267267
list{"b", "b"},
268268
list{"a", "a", "a"},
@@ -395,7 +395,7 @@ describe("sum", () => {
395395

396396
let zero = ""
397397

398-
let add = \"^"
398+
let add = \"++"
399399
}
400400
),
401401
),

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
]
3737
},
3838
"peerDependencies": {
39-
"rescript": "^12.0.0-alpha.7"
39+
"rescript": "^12.0.0-alpha.8"
4040
},
4141
"devDependencies": {
4242
"@changesets/cli": "^2.27.11",
@@ -45,7 +45,7 @@
4545
"@swc/jest": "^0.2.37",
4646
"jest": "^29.7.0",
4747
"onchange": "^7.1.0",
48-
"rescript": "^12.0.0-alpha.7",
48+
"rescript": "^12.0.0-alpha.8",
4949
"tap-difflet": "^0.7.2"
5050
}
5151
}

src/Stdlib__List_Ext.res.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as TableclothList from "./Tablecloth/TableclothList.res.mjs";
66
import * as Primitive_option from "rescript/lib/es6/Primitive_option.js";
77

88
function listToOption(l) {
9-
if (l) {
9+
if (l !== 0) {
1010
return Primitive_option.some(l.hd);
1111
}
1212

@@ -28,11 +28,11 @@ function foldRight0(xs, f) {
2828
function transpose(_a) {
2929
while (true) {
3030
let a = _a;
31-
if (!a) {
31+
if (a === 0) {
3232
return /* [] */0;
3333
}
3434
let match = a.hd;
35-
if (match) {
35+
if (match !== 0) {
3636
let match$1 = List.unzip(List.map(a.tl, y => [
3737
List.headExn(y),
3838
List.tailExn(y)

src/Tablecloth/TableclothBool.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ let toInt = t => t ? 1 : 0
2626

2727
let compare = compare
2828

29-
let equal = \"="
29+
let equal = \"=="

src/Tablecloth/TableclothChar.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ let isWhitespace = x =>
8989
| _ => false
9090
}
9191

92-
let equal = \"="
92+
let equal = \"=="
9393

9494
let compare = compare

src/Tablecloth/TableclothList.res.mjs

+17-17
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function flatMap(t, f) {
4747
let map2 = List.zipBy;
4848

4949
function map3(a, b, c, f) {
50-
if (a && b && c) {
50+
if (a !== 0 && b !== 0 && c !== 0) {
5151
return {
5252
hd: f(a.hd, b.hd, c.hd),
5353
tl: map3(a.tl, b.tl, c.tl, f)
@@ -60,11 +60,11 @@ function map3(a, b, c, f) {
6060
function last(_l) {
6161
while (true) {
6262
let l = _l;
63-
if (!l) {
63+
if (l === 0) {
6464
return;
6565
}
6666
let rest = l.tl;
67-
if (!rest) {
67+
if (rest === 0) {
6868
return Primitive_option.some(l.hd);
6969
}
7070
_l = rest;
@@ -80,7 +80,7 @@ function uniqueBy(l, f) {
8080
let accumulator = _accumulator;
8181
let remaining = _remaining;
8282
let existing = _existing;
83-
if (!remaining) {
83+
if (remaining === 0) {
8484
return List.reverse(accumulator);
8585
}
8686
let rest = remaining.tl;
@@ -108,7 +108,7 @@ function any(t, f) {
108108

109109
function initial(l) {
110110
let match = List.reverse(l);
111-
if (match) {
111+
if (match !== 0) {
112112
return List.reverse(match.tl);
113113
}
114114

@@ -134,7 +134,7 @@ function findIndex(list, f) {
134134
while (true) {
135135
let l = _l;
136136
let i = _i;
137-
if (!l) {
137+
if (l === 0) {
138138
return;
139139
}
140140
let x = l.hd;
@@ -163,7 +163,7 @@ function updateAt(t, index, f) {
163163
function dropWhile(_t, f) {
164164
while (true) {
165165
let t = _t;
166-
if (!t) {
166+
if (t === 0) {
167167
return /* [] */0;
168168
}
169169
if (!f(t.hd)) {
@@ -222,7 +222,7 @@ function takeWhile(t, f) {
222222
while (true) {
223223
let t$1 = _t;
224224
let acc = _acc;
225-
if (!t$1) {
225+
if (t$1 === 0) {
226226
return List.reverse(acc);
227227
}
228228
let x = t$1.hd;
@@ -270,12 +270,12 @@ function minimumBy(l, f) {
270270
];
271271
}
272272
};
273-
if (!l) {
273+
if (l === 0) {
274274
return;
275275
}
276276
let rest = l.tl;
277277
let x = l.hd;
278-
if (rest) {
278+
if (rest !== 0) {
279279
return Primitive_option.some(fold(rest, [
280280
x,
281281
f(x)
@@ -301,12 +301,12 @@ function maximumBy(l, f) {
301301
];
302302
}
303303
};
304-
if (!l) {
304+
if (l === 0) {
305305
return;
306306
}
307307
let rest = l.tl;
308308
let x = l.hd;
309-
if (rest) {
309+
if (rest !== 0) {
310310
return Primitive_option.some(fold(rest, [
311311
x,
312312
f(x)
@@ -370,7 +370,7 @@ function sortBy(l, f) {
370370
function groupWhile(l, f) {
371371
let $$break = (param, x, y) => f(x, y);
372372
let groups = Belt_List.reduceWithIndex(l, /* [] */0, (acc, x, i) => {
373-
if (!acc) {
373+
if (acc === 0) {
374374
return {
375375
hd: {
376376
hd: x,
@@ -402,7 +402,7 @@ function groupWhile(l, f) {
402402
};
403403
}
404404
});
405-
if (groups) {
405+
if (groups !== 0) {
406406
return Belt_List.mapReverse(groups, List.reverse);
407407
} else {
408408
return /* [] */0;
@@ -427,7 +427,7 @@ function splitWhen(t, f) {
427427
while (true) {
428428
let back = _back;
429429
let front = _front;
430-
if (!back) {
430+
if (back === 0) {
431431
return [
432432
t,
433433
/* [] */0
@@ -450,12 +450,12 @@ function splitWhen(t, f) {
450450
}
451451

452452
function intersperse(t, sep) {
453-
if (!t) {
453+
if (t === 0) {
454454
return /* [] */0;
455455
}
456456
let rest = t.tl;
457457
let x = t.hd;
458-
if (rest) {
458+
if (rest !== 0) {
459459
return {
460460
hd: x,
461461
tl: foldRight(rest, /* [] */0, (acc, x) => ({

src/Tablecloth/TableclothTuple2.res.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ function fromArray(array) {
3131
}
3232

3333
function fromList(list) {
34-
if (!list) {
34+
if (list === 0) {
3535
return;
3636
}
3737
let match = list.tl;
38-
if (match) {
38+
if (match !== 0) {
3939
return [
4040
list.hd,
4141
match.hd

src/Tablecloth/TableclothTuple3.res.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ function fromArray(array) {
3636
}
3737

3838
function fromList(list) {
39-
if (!list) {
39+
if (list === 0) {
4040
return;
4141
}
4242
let match = list.tl;
43-
if (!match) {
43+
if (match === 0) {
4444
return;
4545
}
4646
let match$1 = match.tl;
47-
if (match$1) {
47+
if (match$1 !== 0) {
4848
return [
4949
list.hd,
5050
match.hd,

src/Tablecloth/TableclothTuple4.res.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ function fromArray(array) {
4141
}
4242

4343
function fromList(list) {
44-
if (!list) {
44+
if (list === 0) {
4545
return;
4646
}
4747
let match = list.tl;
48-
if (!match) {
48+
if (match === 0) {
4949
return;
5050
}
5151
let match$1 = match.tl;
52-
if (!match$1) {
52+
if (match$1 === 0) {
5353
return;
5454
}
5555
let match$2 = match$1.tl;
56-
if (match$2) {
56+
if (match$2 !== 0) {
5757
return [
5858
list.hd,
5959
match.hd,

0 commit comments

Comments
 (0)