Skip to content

Commit 4e828c6

Browse files
committed
Js.Array2 -> Array
1 parent 97e74d5 commit 4e828c6

29 files changed

+100
-1268
lines changed

tests/build_tests/uncurried-always/src/UncurriedAlways.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ let a = 3->foo(4)
1212

1313
Console.log(a) // Test automatic uncurried application
1414

15-
let _ = Js.Array2.map([1], x => x + 1)
15+
let _ = Array.map([1], x => x + 1)

tests/syntax_benchmarks/data/RedBlackTree.res

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ let make = (~compare) => {size: 0, root: None, compare}
515515

516516
let makeWith = (array, ~compare) => {
517517
let rbt = make(~compare)
518-
array->Js.Array2.forEach(((value, height)) => add(rbt,value, ~height)->ignore)
518+
array->Array.forEach(((value, height)) => add(rbt,value, ~height)->ignore)
519519
rbt
520520
}
521521

@@ -705,7 +705,7 @@ let onChangedVisible =
705705
let old = oldNewVisible.new
706706
let new = oldNewVisible.old
707707
// empty new
708-
new->Js.Array2.removeCountInPlace(~pos=0, ~count=new->Js.Array2.length)->ignore
708+
new->Array.removeCountInPlace(~pos=0, ~count=new->Array.length)->ignore
709709
oldNewVisible.old = old
710710
oldNewVisible.new = new
711711

@@ -718,21 +718,21 @@ let onChangedVisible =
718718
let first = firstVisibleNode(rbt.root, top)
719719
let last = lastVisibleNode(rbt.root, bottom)
720720

721-
let oldLen = old->Js.Array2.length
721+
let oldLen = old->Array.length
722722
let oldIter = ref(0)
723723
iterateWithY(~inclusive=true, first, last, ~callback=(. node, y_) => {
724724
let y = y_ +. anchorDelta
725725
if y >= 0.0 { // anchoring can make y negative
726726
while (
727727
oldIter.contents < oldLen &&
728-
rbt.compare(. Js.Array2.unsafe_get(old, oldIter.contents), node.value) < 0
728+
rbt.compare(. Array.unsafe_get(old, oldIter.contents), node.value) < 0
729729
) {
730-
disappear(. Js.Array2.unsafe_get(old, oldIter.contents))
730+
disappear(. Array.unsafe_get(old, oldIter.contents))
731731
oldIter.contents = oldIter.contents + 1
732732
}
733-
new->Js.Array2.push(node.value)->ignore
733+
new->Array.push(node.value)->ignore
734734
if (oldIter.contents < oldLen) {
735-
let cmp = rbt.compare(. Js.Array2.unsafe_get(old, oldIter.contents), node.value)
735+
let cmp = rbt.compare(. Array.unsafe_get(old, oldIter.contents), node.value)
736736
if cmp == 0 {
737737
remained(. node, y)
738738
oldIter.contents = oldIter.contents + 1
@@ -745,7 +745,7 @@ let onChangedVisible =
745745
}
746746
})
747747
while (oldIter.contents < oldLen) {
748-
disappear(. Js.Array2.unsafe_get(old, oldIter.contents))
748+
disappear(. Array.unsafe_get(old, oldIter.contents))
749749
oldIter.contents = oldIter.contents + 1
750750
}
751751
};

tests/syntax_benchmarks/data/RedBlackTreeNoComments.res

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ let make = (~compare) => {size: 0, root: None, compare: compare}
413413

414414
let makeWith = (array, ~compare) => {
415415
let rbt = make(~compare)
416-
array->Js.Array2.forEach(((value, height)) =>
416+
array->Array.forEach(((value, height)) =>
417417
add(rbt, value, ~height)->ignore
418418
)
419419
rbt
@@ -590,7 +590,7 @@ let onChangedVisible = (
590590
let new = oldNewVisible.old
591591

592592
new
593-
->Js.Array2.removeCountInPlace(~pos=0, ~count=new->Js.Array2.length)
593+
->Array.removeCountInPlace(~pos=0, ~count=new->Array.length)
594594
->ignore
595595
oldNewVisible.old = old
596596
oldNewVisible.new = new
@@ -604,25 +604,25 @@ let onChangedVisible = (
604604
let first = firstVisibleNode(rbt.root, top)
605605
let last = lastVisibleNode(rbt.root, bottom)
606606

607-
let oldLen = old->Js.Array2.length
607+
let oldLen = old->Array.length
608608
let oldIter = ref(0)
609609
iterateWithY(~inclusive=true, first, last, (. node, y_) => {
610610
let y = y_ +. anchorDelta
611611
if y >= 0.0 {
612612
while (
613613
oldIter.contents < oldLen &&
614614
rbt.compare(.
615-
Js.Array2.unsafe_get(old, oldIter.contents),
615+
Array.unsafe_get(old, oldIter.contents),
616616
node.value,
617617
) < 0
618618
) {
619-
disappear(. Js.Array2.unsafe_get(old, oldIter.contents))
619+
disappear(. Array.unsafe_get(old, oldIter.contents))
620620
oldIter.contents = oldIter.contents + 1
621621
}
622-
new->Js.Array2.push(node.value)->ignore
622+
new->Array.push(node.value)->ignore
623623
if oldIter.contents < oldLen {
624624
let cmp = rbt.compare(.
625-
Js.Array2.unsafe_get(old, oldIter.contents),
625+
Array.unsafe_get(old, oldIter.contents),
626626
node.value,
627627
)
628628
if cmp == 0 {
@@ -637,7 +637,7 @@ let onChangedVisible = (
637637
}
638638
})
639639
while oldIter.contents < oldLen {
640-
disappear(. Js.Array2.unsafe_get(old, oldIter.contents))
640+
disappear(. Array.unsafe_get(old, oldIter.contents))
641641
oldIter.contents = oldIter.contents + 1
642642
}
643643
}

tests/syntax_tests/data/conversion/reason/braces.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let f = () => id
33

44
if isArray(children) {
55
// Scenario 1
6-
let code = children->asStringArray->Js.Array2.joinWith("")
6+
let code = children->asStringArray->Array.joinWith("")
77
<InlineCode> {code->s} </InlineCode>
88
} else if isObject(children) {
99
// Scenario 2

tests/syntax_tests/data/idempotency/reasonml.org/components/Markdown.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module UrlBox = {
6161
<>
6262
<P> imgEl {headChildren->toReactElement} </P>
6363
{if length > 1 {
64-
arr->Js.Array2.slice(~start=1, ~end_=length)->Mdx.arrToReactElement
64+
arr->Array.slice(~start=1, ~end_=length)->Mdx.arrToReactElement
6565
} else {
6666
React.null
6767
}}
@@ -258,7 +258,7 @@ module Code = {
258258
*/
259259
if isArray(children) {
260260
// Scenario 1
261-
let code = children->asStringArray->Js.Array2.joinWith("")
261+
let code = children->asStringArray->Array.joinWith("")
262262
<InlineCode> {code->s} </InlineCode>
263263
} else if isObject(children) {
264264
// Scenario 2
@@ -360,7 +360,7 @@ module Li = {
360360
arr->getExn(arr->length - 1)
361361
}
362362

363-
let head = Js.Array2.slice(arr, ~start=0, ~end_=arr->Belt.Array.length - 1)
363+
let head = Array.slice(arr, ~start=0, ~end_=arr->Belt.Array.length - 1)
364364

365365
let first = Belt.Array.getExn(head, 0)
366366

tests/syntax_tests/data/idempotency/reasonml.org/layouts/SidebarLayout.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module UrlPath = {
3737
None
3838
} else {
3939
let version = Belt.Array.getExn(allPaths, 0)
40-
let (up, current) = switch Js.Array2.slice(allPaths, ~end_=total, ~start=-2) {
40+
let (up, current) = switch Array.slice(allPaths, ~end_=total, ~start=-2) {
4141
| [up, current] =>
4242
let up = up === version ? None : Some(up)
4343
(up, Some(current))

tests/syntax_tests/data/idempotency/warp/Warp_FormData.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let set = (client, formData) => {
1313
...client,
1414
formData: Belt.List.map(formData, ((key, value)) => key ++ ("=" ++ value))
1515
->Belt.List.toArray
16-
->Js.Array2.joinWith("&")
16+
->Array.joinWith("&")
1717
->Some,
1818
requestType: "application/x-www-form-urlencoded",
1919
}
@@ -30,7 +30,7 @@ let remove = (client, keyToRemove) => {
3030
| _ => true
3131
}
3232
)
33-
->Js.Array2.joinWith("&")
33+
->Array.joinWith("&")
3434
->Some
3535
| None => None
3636
},

tests/syntax_tests/data/idempotency/warp/Warp_QueryString.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let set = (client, queryString) => {
1212
...client,
1313
queryString: Belt.List.map(queryString, ((key, value)) => key ++ ("=" ++ value))
1414
->Belt.List.toArray
15-
->Js.Array2.joinWith("&")
15+
->Array.joinWith("&")
1616
->Some,
1717
}
1818

@@ -28,7 +28,7 @@ let remove = (client, keyToRemove) => {
2828
| _ => true
2929
}
3030
)
31-
->Js.Array2.joinWith("&")
31+
->Array.joinWith("&")
3232
->Some
3333
| None => None
3434
},

tests/syntax_tests/data/idempotency/wildcards-world-ui/TotalContribution.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let useLoadMostContributedData = () => {
3636

3737
(patron.id, totalContributedWei)
3838
})
39-
->Js.Array2.sortInPlaceWith(((_, first), (_, second)) => second->BN.cmp(first))
39+
->Array.sortInPlaceWith(((_, first), (_, second)) => second->BN.cmp(first))
4040
->Some
4141
| _ => None
4242
}

tests/syntax_tests/data/idempotency/wildcards-world-ui/TotalDaysHeld.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let useLoadMostDaysHeldData = () => {
3030

3131
(patron.id, totalTimeHeldWei)
3232
})
33-
->Js.Array2.sortInPlaceWith(((_, first), (_, second)) => second->BN.cmp(first))
33+
->Array.sortInPlaceWith(((_, first), (_, second)) => second->BN.cmp(first))
3434
->Some
3535
| _ => None
3636
}

0 commit comments

Comments
 (0)