-
Notifications
You must be signed in to change notification settings - Fork 482
Expand file tree
/
Copy pathCompletion.res.txt
More file actions
2922 lines (2829 loc) · 165 KB
/
Completion.res.txt
File metadata and controls
2922 lines (2829 loc) · 165 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Complete src/Completion.res 1:11
posCursor:[1:11] posNoWhite:[1:10] Found expr:[1:3->1:11]
Pexp_ident MyList.m:[1:3->1:11]
Completable: Cpath Value[MyList, m]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[MyList, m]
Path MyList.m
[{
"label": "mapReverse",
"kind": 12,
"tags": [],
"detail": "(list<'a>, 'a => 'b) => list<'b>",
"documentation": {"kind": "markdown", "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n"}
}, {
"label": "mapReverse2",
"kind": 12,
"tags": [],
"detail": "(list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>",
"documentation": {"kind": "markdown", "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```\n"}
}, {
"label": "make",
"kind": 12,
"tags": [],
"detail": "(~length: int, 'a) => list<'a>",
"documentation": {"kind": "markdown", "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```\n"}
}, {
"label": "mapWithIndex",
"kind": 12,
"tags": [],
"detail": "(list<'a>, ('a, int) => 'b) => list<'b>",
"documentation": {"kind": "markdown", "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```\n"}
}, {
"label": "map",
"kind": 12,
"tags": [],
"detail": "(list<'a>, 'a => 'b) => list<'b>",
"documentation": {"kind": "markdown", "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n"}
}]
Complete src/Completion.res 3:9
posCursor:[3:9] posNoWhite:[3:8] Found expr:[3:3->3:9]
Pexp_ident Array.:[3:3->3:9]
Completable: Cpath Value[Array, ""]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Array, ""]
Path Array.
[{
"label": "splice",
"kind": 12,
"tags": [],
"detail": "(\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit",
"documentation": {"kind": "markdown", "value": "\n`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```\n"}
}, {
"label": "concat",
"kind": 12,
"tags": [],
"detail": "(array<'a>, array<'a>) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"}
}, {
"label": "filterMap",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => option<'b>) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n"}
}, {
"label": "findLastWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```\n"}
}, {
"label": "findLast",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```\n"}
}, {
"label": "shift",
"kind": 12,
"tags": [],
"detail": "array<'a> => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```\n"}
}, {
"label": "findMap",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => option<'b>) => option<'b>",
"documentation": {"kind": "markdown", "value": "\n`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```\n"}
}, {
"label": "concatMany",
"kind": 12,
"tags": [],
"detail": "(array<'a>, array<array<'a>>) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"}
}, {
"label": "joinWith",
"kind": 12,
"tags": [1],
"detail": "(array<string>, string) => string",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```\n"}
}, {
"label": "joinWithUnsafe",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, string) => string",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n"}
}, {
"label": "reduceRight",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'b, ('b, 'a) => 'b) => 'b",
"documentation": {"kind": "markdown", "value": "\n`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```\n"}
}, {
"label": "reduceRightWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'b, ('b, 'a, int) => 'b) => 'b",
"documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n"}
}, {
"label": "toShuffled",
"kind": 12,
"tags": [],
"detail": "array<'a> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```\n"}
}, {
"label": "getSymbol",
"kind": 12,
"tags": [],
"detail": "(array<'a>, Symbol.t) => option<'b>",
"documentation": {"kind": "markdown", "value": "\n`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```\n"}
}, {
"label": "getSymbolUnsafe",
"kind": 12,
"tags": [],
"detail": "(array<'a>, Symbol.t) => 'b",
"documentation": {"kind": "markdown", "value": "\n`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```\n"}
}, {
"label": "findIndexOpt",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => option<int>",
"documentation": {"kind": "markdown", "value": "\n`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```\n"}
}, {
"label": "shuffle",
"kind": 12,
"tags": [],
"detail": "array<'a> => unit",
"documentation": {"kind": "markdown", "value": "\n`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```\n"}
}, {
"label": "copy",
"kind": 12,
"tags": [],
"detail": "array<'a> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```\n"}
}, {
"label": "setUnsafe",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int, 'a) => unit",
"documentation": {"kind": "markdown", "value": "\n`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n"}
}, {
"label": "findIndexWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => int",
"documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```\n"}
}, {
"label": "someWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => bool",
"documentation": {"kind": "markdown", "value": "\n`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```\n"}
}, {
"label": "slice",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ~start: int=?, ~end: int=?) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```\n"}
}, {
"label": "zip",
"kind": 12,
"tags": [],
"detail": "(t<'a>, array<'b>) => array<('a, 'b)>",
"documentation": {"kind": "markdown", "value": "\n`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nArray.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```\n"}
}, {
"label": "fillToEnd",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, 'a, ~start: int) => unit",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```\n"}
}, {
"label": "includes",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a) => bool",
"documentation": {"kind": "markdown", "value": "\n`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```\n"}
}, {
"label": "findLastIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => int",
"documentation": {"kind": "markdown", "value": "\n`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```\n"}
}, {
"label": "fromInitializer",
"kind": 12,
"tags": [],
"detail": "(~length: int, int => 'a) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```\n"}
}, {
"label": "find",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```\n"}
}, {
"label": "make",
"kind": 12,
"tags": [],
"detail": "(~length: int, 'a) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n"}
}, {
"label": "lastIndexOfFrom",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, 'a, int) => int",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n"}
}, {
"label": "toLocaleString",
"kind": 12,
"tags": [],
"detail": "array<'a> => string",
"documentation": {"kind": "markdown", "value": "\n`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```\n"}
}, {
"label": "toSpliced",
"kind": 12,
"tags": [],
"detail": "(\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```\n"}
}, {
"label": "sort",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, 'a) => Ordering.t) => unit",
"documentation": {"kind": "markdown", "value": "\n`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```\n"}
}, {
"label": "filterMapWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => option<'b>) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n"}
}, {
"label": "length",
"kind": 12,
"tags": [],
"detail": "array<'a> => int",
"documentation": {"kind": "markdown", "value": "\n`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```\n"}
}, {
"label": "every",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => bool",
"documentation": {"kind": "markdown", "value": "\n`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```\n"}
}, {
"label": "flat",
"kind": 12,
"tags": [],
"detail": "array<array<'a>> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```\n"}
}, {
"label": "map",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"}
}, {
"label": "zipBy",
"kind": 12,
"tags": [],
"detail": "(t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>",
"documentation": {"kind": "markdown", "value": "\n`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nArray.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```\n"}
}, {
"label": "with",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int, 'a) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```\n"}
}, {
"label": "lastIndexOfOpt",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a) => option<int>",
"documentation": null
}, {
"label": "toReversed",
"kind": 12,
"tags": [],
"detail": "array<'a> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```\n"}
}, {
"label": "copyWithin",
"kind": 12,
"tags": [],
"detail": "(\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```\n"}
}, {
"label": "toString",
"kind": 12,
"tags": [],
"detail": "array<'a> => string",
"documentation": {"kind": "markdown", "value": "\n`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```\n"}
}, {
"label": "everyWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => bool",
"documentation": {"kind": "markdown", "value": "\n`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```\n"}
}, {
"label": "fill",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a, ~start: int=?, ~end: int=?) => unit",
"documentation": {"kind": "markdown", "value": "\n`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```\n"}
}, {
"label": "findWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```\n"}
}, {
"label": "reverse",
"kind": 12,
"tags": [],
"detail": "array<'a> => unit",
"documentation": {"kind": "markdown", "value": "\n`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```\n"}
}, {
"label": "fromString",
"kind": 12,
"tags": [],
"detail": "string => array<string>",
"documentation": {"kind": "markdown", "value": "\n`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```\n"}
}, {
"label": "findLastIndexWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => int",
"documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```\n"}
}, {
"label": "getUnsafe",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int) => 'a",
"documentation": {"kind": "markdown", "value": "\n`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```\n"}
}, {
"label": "entries",
"kind": 12,
"tags": [],
"detail": "array<'a> => IteratorObject.t<(int, 'a), unit, unknown>",
"documentation": {"kind": "markdown", "value": "\n`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<(int, int), unit, unknown> = array->Array.entries\niterator->IteratorObject.toArray == [(0, 5), (1, 6), (2, 7)]\n```\n"}
}, {
"label": "unshiftMany",
"kind": 12,
"tags": [],
"detail": "(array<'a>, array<'a>) => unit",
"documentation": {"kind": "markdown", "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n"}
}, {
"label": "lastIndexOf",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a, ~from: int=?) => int",
"documentation": {"kind": "markdown", "value": "\n`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n"}
}, {
"label": "fromIterable",
"kind": 12,
"tags": [],
"detail": "Iterable.t<'a> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`fromIterable(iterable)` creates an array from the provided `iterable`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->IteratorObject.asIterable\n->Array.fromIterable == [1, 2]\n```\n"}
}, {
"label": "filter",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n"}
}, {
"label": "compare",
"kind": 12,
"tags": [],
"detail": "(array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t",
"documentation": {"kind": "markdown", "value": "\n`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```\n"}
}, {
"label": "join",
"kind": 12,
"tags": [],
"detail": "(array<string>, string) => string",
"documentation": {"kind": "markdown", "value": "\n`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```\n"}
}, {
"label": "last",
"kind": 12,
"tags": [],
"detail": "array<'a> => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```\n"}
}, {
"label": "ignore",
"kind": 12,
"tags": [],
"detail": "array<'a> => unit",
"documentation": {"kind": "markdown", "value": "\n `ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}
}, {
"label": "isArray",
"kind": 12,
"tags": [],
"detail": "'a => bool",
"documentation": {"kind": "markdown", "value": "\n`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```\n"}
}, {
"label": "values",
"kind": 12,
"tags": [],
"detail": "array<'a> => IteratorObject.t<'a, unit, unknown>",
"documentation": {"kind": "markdown", "value": "\n`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<int, unit, unknown> = array->Array.values\niterator->IteratorObject.toArray == [5, 6, 7]\n```\n "}
}, {
"label": "indexOfOpt",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a) => option<int>",
"documentation": {"kind": "markdown", "value": "\n`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```\n"}
}, {
"label": "forEachWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => unit) => unit",
"documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```\n"}
}, {
"label": "reduce",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'b, ('b, 'a) => 'b) => 'b",
"documentation": {"kind": "markdown", "value": "\n`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```\n"}
}, {
"label": "sliceToEnd",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, ~start: int) => array<'a>",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```\n"}
}, {
"label": "fromArrayLikeWithMap",
"kind": 12,
"tags": [],
"detail": "(arrayLike<'a>, 'a => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike<int> = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```\n"}
}, {
"label": "fillAll",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, 'a) => unit",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```\n"}
}, {
"label": "set",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int, 'a) => unit",
"documentation": {"kind": "markdown", "value": "\n`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n"}
}, {
"label": "isEmpty",
"kind": 12,
"tags": [],
"detail": "array<'a> => bool",
"documentation": {"kind": "markdown", "value": "\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```\n"}
}, {
"label": "filterWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => bool) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n"}
}, {
"label": "findIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => int",
"documentation": {"kind": "markdown", "value": "\n`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```\n"}
}, {
"label": "setSymbol",
"kind": 12,
"tags": [],
"detail": "(array<'a>, Symbol.t, 'b) => unit",
"documentation": {"kind": "markdown", "value": "\n`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```\n"}
}, {
"label": "equal",
"kind": 12,
"tags": [],
"detail": "(array<'a>, array<'a>, ('a, 'a) => bool) => bool",
"documentation": {"kind": "markdown", "value": "\n`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```\n"}
}, {
"label": "concatAll",
"kind": 12,
"tags": [],
"detail": "array<array<'a>> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`concatAll(arrays)` concatenates all arrays in `arrays`, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet arrays = [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\n\nlet result = Array.concatAll(arrays)\n\narrays == [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\nresult == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"}
}, {
"label": "joinUnsafe",
"kind": 12,
"tags": [],
"detail": "(array<'a>, string) => string",
"documentation": {"kind": "markdown", "value": "\n`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n"}
}, {
"label": "mapWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"}
}, {
"label": "flatMapWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => array<'b>) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```\n"}
}, {
"label": "copyWithinToEnd",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, ~target: int, ~start: int) => array<'a>",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```\n"}
}, {
"label": "unshift",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a) => unit",
"documentation": {"kind": "markdown", "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n"}
}, {
"label": "indexOf",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a, ~from: int=?) => int",
"documentation": {"kind": "markdown", "value": "\n`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n"}
}, {
"label": "push",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a) => unit",
"documentation": {"kind": "markdown", "value": "\n`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```\n"}
}, {
"label": "toSorted",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, 'a) => Ordering.t) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```\n"}
}, {
"label": "reduceWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'b, ('b, 'a, int) => 'b) => 'b",
"documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n"}
}, {
"label": "some",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => bool",
"documentation": {"kind": "markdown", "value": "\n`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```\n"}
}, {
"label": "unsafe_get",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, int) => 'a",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n"}
}, {
"label": "partition",
"kind": 12,
"tags": [],
"detail": "(t<'a>, 'a => bool) => (t<'a>, t<'a>)",
"documentation": {"kind": "markdown", "value": "\n`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```\n"}
}, {
"label": "copyAllWithin",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, ~target: int) => array<'a>",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```\n"}
}, {
"label": "keepSome",
"kind": 12,
"tags": [],
"detail": "array<option<'a>> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```\n"}
}, {
"label": "at",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int) => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n"}
}, {
"label": "pop",
"kind": 12,
"tags": [],
"detail": "array<'a> => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```\n"}
}, {
"label": "get",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int) => option<'a>",
"documentation": {"kind": "markdown", "value": "\n`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```\n"}
}, {
"label": "asIterable",
"kind": 12,
"tags": [],
"detail": "array<'a> => Iterable.t<'a>",
"documentation": {"kind": "markdown", "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n"}
}, {
"label": "removeInPlace",
"kind": 12,
"tags": [],
"detail": "(array<'a>, int) => unit",
"documentation": {"kind": "markdown", "value": "\n`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```\n "}
}, {
"label": "findLastIndexOpt",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => bool) => option<int>",
"documentation": {"kind": "markdown", "value": "\n`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```\n"}
}, {
"label": "pushMany",
"kind": 12,
"tags": [],
"detail": "(array<'a>, array<'a>) => unit",
"documentation": {"kind": "markdown", "value": "\n`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"}
}, {
"label": "unzip",
"kind": 12,
"tags": [],
"detail": "array<('a, 'b)> => (t<'a>, array<'b>)",
"documentation": {"kind": "markdown", "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n"}
}, {
"label": "forEach",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => unit) => unit",
"documentation": {"kind": "markdown", "value": "\n`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```\n"}
}, {
"label": "flatMap",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => array<'b>) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```\n"}
}, {
"label": "fromArrayLike",
"kind": 12,
"tags": [],
"detail": "arrayLike<'a> => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike<int> = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```\n"}
}, {
"label": "indexOfFrom",
"kind": 12,
"tags": [1],
"detail": "(array<'a>, 'a, int) => int",
"documentation": {"kind": "markdown", "value": "Deprecated: \n\n"}
}]
Complete src/Completion.res 5:10
posCursor:[5:10] posNoWhite:[5:9] Found expr:[5:3->5:10]
Pexp_ident Array.m:[5:3->5:10]
Completable: Cpath Value[Array, m]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Array, m]
Path Array.m
[{
"label": "make",
"kind": 12,
"tags": [],
"detail": "(~length: int, 'a) => array<'a>",
"documentation": {"kind": "markdown", "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n"}
}, {
"label": "map",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"}
}, {
"label": "mapWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"}
}]
Complete src/Completion.res 15:17
posCursor:[15:17] posNoWhite:[15:16] Found expr:[15:12->15:17]
Pexp_ident Dep.c:[15:12->15:17]
Completable: Cpath Value[Dep, c]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Dep, c]
Path Dep.c
[{
"label": "customDouble",
"kind": 12,
"tags": [1],
"detail": "int => int",
"documentation": {"kind": "markdown", "value": "Deprecated: Use customDouble instead\n\nSome doc comment"}
}]
Complete src/Completion.res 23:20
posCursor:[23:20] posNoWhite:[23:19] Found expr:[23:11->23:20]
Pexp_apply ...[23:11->23:18] ()
Completable: CnamedArg(Value[Lib, foo], "", [])
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Lib, foo]
Path Lib.foo
Found type for function (~age: int, ~name: string) => string
[{
"label": "age",
"kind": 4,
"tags": [],
"detail": "int",
"documentation": null
}, {
"label": "name",
"kind": 4,
"tags": [],
"detail": "string",
"documentation": null
}]
Complete src/Completion.res 26:13
posCursor:[26:13] posNoWhite:[26:12] Found expr:[26:3->26:13]
Completable: Cpath array<int>->m
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath array<int>->m
ContextPath array<int>
Path Stdlib.Array.m
Path ArrayUtils.m
Path m
[{
"label": "Array.map",
"kind": 12,
"tags": [],
"detail": "(array<'a>, 'a => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"}
}, {
"label": "Array.mapWithIndex",
"kind": 12,
"tags": [],
"detail": "(array<'a>, ('a, int) => 'b) => array<'b>",
"documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"}
}]
Complete src/Completion.res 29:13
posCursor:[29:13] posNoWhite:[29:12] Found expr:[29:3->29:13]
Completable: Cpath string->toU
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath string->toU
ContextPath string
Path Stdlib.String.toU
Path toU
[{
"label": "String.toUpperCase",
"kind": 12,
"tags": [],
"detail": "string => string",
"documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n"}
}]
Complete src/Completion.res 34:8
posCursor:[34:8] posNoWhite:[34:7] Found expr:[34:3->34:8]
Completable: Cpath Value[op]->e
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[op]->e
ContextPath Value[op]
Path op
Path Stdlib.Option.e
Path e
[{
"label": "Option.equal",
"kind": 12,
"tags": [],
"detail": "(option<'a>, option<'b>, ('a, 'b) => bool) => bool",
"documentation": {"kind": "markdown", "value": "\n`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```\n"}
}]
Complete src/Completion.res 44:7
posCursor:[44:7] posNoWhite:[44:6] Found expr:[44:3->54:3]
Pexp_apply ...[50:9->50:10] (...[44:3->50:8], ...[51:2->54:3])
posCursor:[44:7] posNoWhite:[44:6] Found expr:[44:3->50:8]
Completable: Cpath Value[fa]->
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[fa]->
ContextPath Value[fa]
Path fa
CPPipe pathFromEnv:ForAuto found:true
Path ForAuto.
Path
[{
"label": "ForAuto.abc",
"kind": 12,
"tags": [],
"detail": "(t, int) => t",
"documentation": null
}, {
"label": "ForAuto.abd",
"kind": 12,
"tags": [],
"detail": "(t, int) => t",
"documentation": null
}]
Complete src/Completion.res 47:21
XXX Not found!
[]
Complete src/Completion.res 59:30
posCursor:[59:30] posNoWhite:[59:29] Found expr:[59:14->59:30]
JSX <O.Comp:[59:15->59:21] second[59:22->59:28]=...[59:29->59:30]> _children:None
Completable: Cexpression CJsxPropValue [O, Comp] second=z
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath CJsxPropValue [O, Comp] second
Path O.Comp.make
[{
"label": "zzz",
"kind": 12,
"tags": [],
"detail": "int",
"documentation": null
}]
Complete src/Completion.res 62:23
posCursor:[62:23] posNoWhite:[62:22] Found expr:[62:14->62:23]
JSX <O.Comp:[62:15->62:21] z[62:22->62:23]=...[62:22->62:23]> _children:None
Completable: Cjsx([O, Comp], z, [z])
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
Path O.Comp.make
[{
"label": "zoo",
"kind": 4,
"tags": [],
"detail": "option<int>",
"documentation": null
}]
Complete src/Completion.res 65:8
Attribute id:reac:[65:3->65:8] label:reac
Completable: Cdecorator(reac)
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
[{
"label": "react.component",
"kind": 4,
"tags": [],
"detail": "",
"documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."},
"insertTextFormat": 2
}, {
"label": "react.componentWithProps",
"kind": 4,
"tags": [],
"detail": "",
"documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)."},
"insertTextFormat": 2
}]
Complete src/Completion.res 68:10
posCursor:[68:10] posNoWhite:[68:9] Found expr:[0:-1->86:1]
Pexp_apply ...[80:6->80:7] (...[80:8->86:1])
Attribute id:react.let:[68:3->80:3] label:react.
Completable: Cdecorator(react.)
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
[{
"label": "component",
"kind": 4,
"tags": [],
"detail": "",
"documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."},
"insertTextFormat": 2
}, {
"label": "componentWithProps",
"kind": 4,
"tags": [],
"detail": "",
"documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)."},
"insertTextFormat": 2
}]
Complete src/Completion.res 71:27
posCursor:[71:27] posNoWhite:[71:26] Found expr:[71:11->71:27]
Pexp_apply ...[71:11->71:18] (~name71:20->71:24=...[71:20->71:24])
Completable: CnamedArg(Value[Lib, foo], "", [name])
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Lib, foo]
Path Lib.foo
Found type for function (~age: int, ~name: string) => string
[{
"label": "age",
"kind": 4,
"tags": [],
"detail": "int",
"documentation": null
}]
Complete src/Completion.res 74:26
posCursor:[74:26] posNoWhite:[74:25] Found expr:[74:11->74:26]
Pexp_apply ...[74:11->74:18] (~age74:20->74:23=...[74:20->74:23])
Completable: CnamedArg(Value[Lib, foo], "", [age])
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Lib, foo]
Path Lib.foo
Found type for function (~age: int, ~name: string) => string
[{
"label": "name",
"kind": 4,
"tags": [],
"detail": "string",
"documentation": null
}]
Complete src/Completion.res 77:32
posCursor:[77:32] posNoWhite:[77:31] Found expr:[77:11->77:32]
Pexp_apply ...[77:11->77:18] (~age77:20->77:23=...[77:25->77:28])
Completable: CnamedArg(Value[Lib, foo], "", [age])
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Lib, foo]
Path Lib.foo
Found type for function (~age: int, ~name: string) => string
[{
"label": "name",
"kind": 4,
"tags": [],
"detail": "string",
"documentation": null
}]
Complete src/Completion.res 82:5
posCursor:[82:5] posNoWhite:[82:4] Found expr:[80:8->86:1]
Pexp_apply ...[80:8->80:15] (~age84:3->84:6=...[84:7->84:8], ~name85:3->85:7=...[85:8->85:10])
Completable: CnamedArg(Value[Lib, foo], "", [age, name])
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[Lib, foo]
Path Lib.foo
Found type for function (~age: int, ~name: string) => string
[]
Complete src/Completion.res 90:13
posCursor:[90:13] posNoWhite:[90:12] Found expr:[90:3->93:18]
Pexp_send a[90:12->90:13] e:[90:3->90:10]
Completable: Cpath Value[someObj]["a"]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[someObj]["a"]
ContextPath Value[someObj]
Path someObj
[{
"label": "age",
"kind": 4,
"tags": [],
"detail": "int",
"documentation": null
}]
Complete src/Completion.res 95:24
posCursor:[95:24] posNoWhite:[95:23] Found expr:[95:3->99:6]
Pexp_send [95:24->95:24] e:[95:3->95:22]
Completable: Cpath Value[nestedObj]["x"]["y"][""]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[nestedObj]["x"]["y"][""]
ContextPath Value[nestedObj]["x"]["y"]
ContextPath Value[nestedObj]["x"]
ContextPath Value[nestedObj]
Path nestedObj
[{
"label": "age",
"kind": 4,
"tags": [],
"detail": "int",
"documentation": null
}, {
"label": "name",
"kind": 4,
"tags": [],
"detail": "string",
"documentation": null
}]
Complete src/Completion.res 99:7
posCursor:[99:7] posNoWhite:[99:6] Found expr:[99:3->102:20]
Pexp_send a[99:6->99:7] e:[99:3->99:4]
Completable: Cpath Value[o]["a"]
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
Resolved opens 1 Stdlib
ContextPath Value[o]["a"]
ContextPath Value[o]