Skip to content

Commit 2a268f5

Browse files
committed
Format the repository with multi-line item spacing
The previous commit makes the formatter put a blank line around module items that span several lines. `make format` applies it to the ReScript sources it covers: 353 files gain 1179 blank lines and lose nothing. rewatch/testrepo/packages/dep02/src/Array.res gains one too: the rewatch format test expects exactly the testrepo's 8 deliberately unformatted files to change. The outputs that record source line numbers follow: the super_errors snapshots, the `assert` locations in the generated test JavaScript, the doc-extraction snapshots of tests/tools_tests, and the locations in React.res and JsxEvent.res that the completion and reanalyze snapshots of tests/analysis_tests point to. Signed-off-by: Roland Peelen <roland@magic.dev>
1 parent a945ece commit 2a268f5

503 files changed

Lines changed: 2554 additions & 1373 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/@rescript/belt/src/Belt_Array.resi‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ let rangeBy: (int, int, ~step: int) => array<int>
191191

192192
@deprecated("Use `makeBy` instead")
193193
let makeByU: (int, int => 'a) => t<'a>
194+
194195
/**
195196
`makeBy(n, f)` return an empty array when n is negative return an array of size
196197
n populated by `f(i)` start from `0` to `n - 1`.
@@ -207,6 +208,7 @@ let makeBy: (int, int => 'a) => t<'a>
207208

208209
@deprecated("Use `makeByAndShuffle` instead")
209210
let makeByAndShuffleU: (int, int => 'a) => t<'a>
211+
210212
/**
211213
Equivalent to `shuffle(makeBy(n, f))`
212214
*/
@@ -226,6 +228,7 @@ let zip: (t<'a>, array<'b>) => array<('a, 'b)>
226228

227229
@deprecated("Use `zipBy` instead")
228230
let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>
231+
229232
/**
230233
`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of
231234
`xs` and `ys`. Stops with shorter array.
@@ -382,6 +385,7 @@ let blitUnsafe: (~src: t<'a>, ~srcOffset: int, ~dst: t<'a>, ~dstOffset: int, ~le
382385

383386
@deprecated("Use `forEach` instead")
384387
let forEachU: (t<'a>, 'a => unit) => unit
388+
385389
/**
386390
`forEach(xs, f)`
387391
@@ -411,6 +415,7 @@ let forEach: (t<'a>, 'a => unit) => unit
411415

412416
@deprecated("Use `map` instead")
413417
let mapU: (t<'a>, 'a => 'b) => array<'b>
418+
414419
/**
415420
`map(xs, f)` returns a new array by calling `f` for each element of `xs` from
416421
the beginning to end.
@@ -425,6 +430,7 @@ let map: (t<'a>, 'a => 'b) => array<'b>
425430

426431
@deprecated("Use `flatMap` instead")
427432
let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>
433+
428434
/**
429435
`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from
430436
the beginning to end, concatenating the results.
@@ -439,6 +445,7 @@ let flatMap: (t<'a>, 'a => array<'b>) => array<'b>
439445

440446
@deprecated("Use `getBy` instead")
441447
let getByU: (t<'a>, 'a => bool) => option<'a>
448+
442449
/**
443450
`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies
444451
the predicate function `p`; returns `None` if no element satisifies the function.
@@ -454,6 +461,7 @@ let getBy: (t<'a>, 'a => bool) => option<'a>
454461

455462
@deprecated("Use `getIndexBy` instead")
456463
let getIndexByU: (t<'a>, 'a => bool) => option<int>
464+
457465
/**
458466
`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that
459467
satisifies the predicate function `p`; returns `None` if no element satisifies
@@ -470,13 +478,15 @@ let getIndexBy: (t<'a>, 'a => bool) => option<int>
470478

471479
@deprecated("Use `keep` instead")
472480
let keepU: (t<'a>, 'a => bool) => t<'a>
481+
473482
/**
474483
`keep(xs, p)` returns a new array that keep all elements satisfy `p`.
475484
*/
476485
let keep: (t<'a>, 'a => bool) => t<'a>
477486

478487
@deprecated("Use `keepWithIndex` instead")
479488
let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>
489+
480490
/**
481491
`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.
482492
@@ -490,6 +500,7 @@ let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>
490500

491501
@deprecated("Use `keepMap` instead")
492502
let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>
503+
493504
/**
494505
`keepMap(xs, p)` returns a new array that keep all elements that return a non
495506
None applied `p`.
@@ -510,6 +521,7 @@ let keepMap: (t<'a>, 'a => option<'b>) => array<'b>
510521

511522
@deprecated("Use `forEachWithIndex` instead")
512523
let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit
524+
513525
/**
514526
`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is
515527
supplied two arguments: the index starting from 0 and the element from `xs`.
@@ -538,6 +550,7 @@ let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit
538550

539551
@deprecated("Use `mapWithIndex` instead")
540552
let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>
553+
541554
/**
542555
`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes
543556
two arguments: the index starting from 0 and the element from `xs`.
@@ -552,6 +565,7 @@ let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>
552565

553566
@deprecated("Use `partition` instead")
554567
let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)
568+
555569
/**
556570
`partition(f, a)` split array into tuple of two arrays based on predicate `f`;
557571
first of tuple where predicate cause true, second where predicate cause false
@@ -568,6 +582,7 @@ let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)
568582

569583
@deprecated("Use `reduce` instead")
570584
let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a
585+
571586
/**
572587
`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.
573588
Function `f` has two parameters: the item from the list and an “accumulator”;
@@ -586,6 +601,7 @@ let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a
586601

587602
@deprecated("Use `reduceReverse` instead")
588603
let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a
604+
589605
/**
590606
`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that
591607
function `f` is applied to each item of `xs` from the last back to the first.
@@ -600,6 +616,7 @@ let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a
600616

601617
@deprecated("Use `reduceReverse2` instead")
602618
let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c
619+
603620
/**
604621
`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items
605622
starting at `min(length(xs), length(ys))` down to and including zero.
@@ -614,6 +631,7 @@ let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c
614631

615632
@deprecated("Use `reduceWithIndex` instead")
616633
let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b
634+
617635
/**
618636
Applies `f` to each element of `xs` from beginning to end. Function `f` has
619637
three parameters: the item from the array and an “accumulator”, which starts
@@ -630,6 +648,7 @@ let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b
630648

631649
@deprecated("Use `joinWith` instead")
632650
let joinWithU: (t<'a>, string, 'a => string) => string
651+
633652
/**
634653
`joinWith(xs, sep, toString)`
635654
@@ -650,6 +669,7 @@ let joinWith: (t<'a>, string, 'a => string) => string
650669

651670
@deprecated("Use `some` instead")
652671
let someU: (t<'a>, 'a => bool) => bool
672+
653673
/**
654674
`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;
655675
where `p` is a predicate: a function taking an element and returning a `bool`.
@@ -666,6 +686,7 @@ let some: (t<'a>, 'a => bool) => bool
666686

667687
@deprecated("Use `every` instead")
668688
let everyU: (t<'a>, 'a => bool) => bool
689+
669690
/**
670691
`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a
671692
predicate: a function taking an element and returning a `bool`.
@@ -682,6 +703,7 @@ let every: (t<'a>, 'a => bool) => bool
682703

683704
@deprecated("Use `every2` instead")
684705
let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool
706+
685707
/**
686708
`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of
687709
elements up to the shorter length (i.e. `min(length(xs), length(ys))`)
@@ -702,6 +724,7 @@ let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool
702724

703725
@deprecated("Use `some2` instead")
704726
let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool
727+
705728
/**
706729
`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements
707730
up to the shorter length (i.e. `min(length(xs), length(ys))`)
@@ -720,6 +743,7 @@ let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool
720743

721744
@deprecated("Use `cmp` instead")
722745
let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int
746+
723747
/**
724748
`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`
725749
if `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise
@@ -742,6 +766,7 @@ let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int
742766

743767
@deprecated("Use `eq` instead")
744768
let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool
769+
745770
/**
746771
`eq(xs, ys)` return `false` if length is not the same otherwise compare items
747772
one by one using `f(xi, yi)`; and return true if all results are true false otherwise
@@ -774,6 +799,7 @@ external truncateToLengthUnsafe: (t<'a>, int) => unit = "length"
774799

775800
@deprecated("Use `init` instead")
776801
let initU: (int, int => 'a) => t<'a>
802+
777803
let init: (int, int => 'a) => t<'a>
778804

779805
/**

‎packages/@rescript/belt/src/Belt_HashMap.resi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit
249249

250250
@deprecated("Use `reduce` instead")
251251
let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c
252+
252253
/**
253254
`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.
254255

‎packages/@rescript/belt/src/Belt_HashMapInt.resi‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ let remove: (t<'a>, key) => unit
2323

2424
@deprecated("Use `forEach` instead")
2525
let forEachU: (t<'b>, (key, 'b) => unit) => unit
26+
2627
let forEach: (t<'b>, (key, 'b) => unit) => unit
2728

2829
@deprecated("Use `reduce` instead")
2930
let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c
31+
3032
let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c
3133

3234
@deprecated("Use `keepMapInPlace` instead")
3335
let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit
36+
3437
let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit
3538

3639
let size: t<_> => int

‎packages/@rescript/belt/src/Belt_HashMapString.resi‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ let remove: (t<'a>, key) => unit
2323

2424
@deprecated("Use `forEach` instead")
2525
let forEachU: (t<'b>, (key, 'b) => unit) => unit
26+
2627
let forEach: (t<'b>, (key, 'b) => unit) => unit
2728

2829
@deprecated("Use `reduce` instead")
2930
let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c
31+
3032
let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c
3133

3234
@deprecated("Use `keepMapInPlace` instead")
3335
let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit
36+
3437
let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit
3538

3639
let size: t<_> => int

‎packages/@rescript/belt/src/Belt_HashSet.resi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ let remove: (t<'a, 'id>, 'a) => unit
7575

7676
@deprecated("Use `forEach` instead")
7777
let forEachU: (t<'a, 'id>, 'a => unit) => unit
78+
7879
/** Order unspecified. */
7980
let forEach: (t<'a, 'id>, 'a => unit) => unit
8081

8182
@deprecated("Use `reduce` instead")
8283
let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c
84+
8385
/** Order unspecified. */
8486
let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c
8587

‎packages/@rescript/belt/src/Belt_HashSetInt.resi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ let remove: (t, key) => unit
3333

3434
@deprecated("Use `forEach` instead")
3535
let forEachU: (t, key => unit) => unit
36+
3637
let forEach: (t, key => unit) => unit
3738

3839
@deprecated("Use `reduce` instead")
3940
let reduceU: (t, 'c, ('c, key) => 'c) => 'c
41+
4042
let reduce: (t, 'c, ('c, key) => 'c) => 'c
4143

4244
let size: t => int

‎packages/@rescript/belt/src/Belt_HashSetString.resi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ let remove: (t, key) => unit
3333

3434
@deprecated("Use `forEach` instead")
3535
let forEachU: (t, key => unit) => unit
36+
3637
let forEach: (t, key => unit) => unit
3738

3839
@deprecated("Use `reduce` instead")
3940
let reduceU: (t, 'c, ('c, key) => 'c) => 'c
41+
4042
let reduce: (t, 'c, ('c, key) => 'c) => 'c
4143

4244
let size: t => int

‎packages/@rescript/belt/src/Belt_List.res‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ let take = (lst, n) =>
316316
}
317317
}
318318
}
319+
319320
/* invariant `n >= 0 ` */
320321
let rec dropAux = (l, n) =>
321322
if n == 0 {

‎packages/@rescript/belt/src/Belt_Map.res‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ let update = (m, key, f) => {
6262
let cmp = m.cmp
6363
{cmp, data: Dict.update(~cmp, m.data, key, f)}
6464
}
65+
6566
let split = (m, x) => {
6667
let cmp = m.cmp
6768
let ((l, r), b) = Dict.split(~cmp, m.data, x)

0 commit comments

Comments
 (0)