Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 39310c3

Browse files
committed
Remove @uncurry
1 parent ede3ae1 commit 39310c3

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

js/src/js_array2.res

+20-20
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ let code = s => Js.String.charCodeAt(0, s)
9797
Js.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]
9898
```
9999
*/
100-
external fromMap: (array_like<'a>, @uncurry 'a => 'b) => array<'b> = "Array.from"
100+
external fromMap: (array_like<'a>, 'a => 'b) => array<'b> = "Array.from"
101101

102102
/* ES2015 */
103103

@@ -399,7 +399,7 @@ let reverseNumeric = (n1, n2) => n2 - n1
399399
Js.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]
400400
```
401401
*/
402-
external sortInPlaceWith: (t<'a>, @uncurry ('a, 'a) => int) => t<'a> = "sort"
402+
external sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a> = "sort"
403403

404404
@send
405405
@variadic
@@ -740,7 +740,7 @@ Js.Array2.every([6, 22, 8, 4], isEven) == true
740740
Js.Array2.every([6, 22, 7, 4], isEven) == false
741741
```
742742
*/
743-
external every: (t<'a>, @uncurry 'a => bool) => bool = "every"
743+
external every: (t<'a>, 'a => bool) => bool = "every"
744744

745745
@send
746746
/**
@@ -762,7 +762,7 @@ Js.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true
762762
Js.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false
763763
```
764764
*/
765-
external everyi: (t<'a>, @uncurry ('a, int) => bool) => bool = "every"
765+
external everyi: (t<'a>, ('a, int) => bool) => bool = "every"
766766

767767
@send
768768
/**
@@ -779,7 +779,7 @@ let nonEmpty = s => s != ""
779779
Js.Array2.filter(["abc", "", "", "def", "ghi"], nonEmpty) == ["abc", "def", "ghi"]
780780
```
781781
*/
782-
external filter: (t<'a>, @uncurry 'a => bool) => t<'a> = "filter"
782+
external filter: (t<'a>, 'a => bool) => t<'a> = "filter"
783783

784784
@send
785785
/**
@@ -800,7 +800,7 @@ let positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0
800800
Js.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]
801801
```
802802
*/
803-
external filteri: (t<'a>, @uncurry ('a, int) => bool) => t<'a> = "filter"
803+
external filteri: (t<'a>, ('a, int) => bool) => t<'a> = "filter"
804804

805805
@send
806806
@return({undefined_to_opt: undefined_to_opt})
@@ -818,7 +818,7 @@ Js.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)
818818
Js.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None
819819
```
820820
*/
821-
external find: (t<'a>, @uncurry 'a => bool) => option<'a> = "find"
821+
external find: (t<'a>, 'a => bool) => option<'a> = "find"
822822

823823
/* ES2015 */
824824

@@ -841,7 +841,7 @@ Js.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)
841841
Js.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None
842842
```
843843
*/
844-
external findi: (t<'a>, @uncurry ('a, int) => bool) => option<'a> = "find"
844+
external findi: (t<'a>, ('a, int) => bool) => option<'a> = "find"
845845

846846
/* ES2015 */
847847

@@ -859,7 +859,7 @@ Js.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2
859859
Js.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1
860860
```
861861
*/
862-
external findIndex: (t<'a>, @uncurry 'a => bool) => int = "findIndex"
862+
external findIndex: (t<'a>, 'a => bool) => int = "findIndex"
863863

864864
/* ES2015 */
865865

@@ -881,7 +881,7 @@ Js.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3
881881
Js.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1
882882
```
883883
*/
884-
external findIndexi: (t<'a>, @uncurry ('a, int) => bool) => int = "findIndex"
884+
external findIndexi: (t<'a>, ('a, int) => bool) => int = "findIndex"
885885

886886
/* ES2015 */
887887

@@ -902,7 +902,7 @@ on MDN.
902902
Js.Array2.forEach(["a", "b", "c"], x => Js.log(x)) == ()
903903
```
904904
*/
905-
external forEach: (t<'a>, @uncurry 'a => unit) => unit = "forEach"
905+
external forEach: (t<'a>, 'a => unit) => unit = "forEach"
906906

907907
@send
908908
/**
@@ -922,7 +922,7 @@ on MDN.
922922
Js.Array2.forEachi(["a", "b", "c"], (item, index) => Js.log2(index + 1, item)) == ()
923923
```
924924
*/
925-
external forEachi: (t<'a>, @uncurry ('a, int) => unit) => unit = "forEach"
925+
external forEachi: (t<'a>, ('a, int) => unit) => unit = "forEach"
926926

927927
/* commented out until bs has a plan for iterators
928928
external keys : 'a t -> int array_iter = "" [@@send] (* ES2015 *)
@@ -943,7 +943,7 @@ Js.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]
943943
Js.Array2.map(["animal", "vegetable", "mineral"], Js.String.length) == [6, 9, 7]
944944
```
945945
*/
946-
external map: (t<'a>, @uncurry 'a => 'b) => t<'b> = "map"
946+
external map: (t<'a>, 'a => 'b) => t<'b> = "map"
947947

948948
@send
949949
/**
@@ -962,7 +962,7 @@ let product = (item, index) => item * index
962962
Js.Array2.mapi([10, 11, 12], product) == [0, 11, 24]
963963
```
964964
*/
965-
external mapi: (t<'a>, @uncurry ('a, int) => 'b) => t<'b> = "map"
965+
external mapi: (t<'a>, ('a, int) => 'b) => t<'b> = "map"
966966

967967
@send
968968
/**
@@ -996,7 +996,7 @@ Js.Array2.reduce(
996996
Js.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)
997997
```
998998
*/
999-
external reduce: (t<'a>, @uncurry ('b, 'a) => 'b, 'b) => 'b = "reduce"
999+
external reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b = "reduce"
10001000

10011001
@send
10021002
/**
@@ -1031,7 +1031,7 @@ let sumOfEvens = (accumulator, item, index) =>
10311031
Js.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6
10321032
```
10331033
*/
1034-
external reducei: (t<'a>, @uncurry ('b, 'a, int) => 'b, 'b) => 'b = "reduce"
1034+
external reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b = "reduce"
10351035

10361036
@send
10371037
/**
@@ -1063,7 +1063,7 @@ Js.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120
10631063
Js.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)
10641064
```
10651065
*/
1066-
external reduceRight: (t<'a>, @uncurry ('b, 'a) => 'b, 'b) => 'b = "reduceRight"
1066+
external reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b = "reduceRight"
10671067

10681068
@send
10691069
/**
@@ -1100,7 +1100,7 @@ let sumOfEvens = (accumulator, item, index) =>
11001100
Js.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6
11011101
```
11021102
*/
1103-
external reduceRighti: (t<'a>, @uncurry ('b, 'a, int) => 'b, 'b) => 'b = "reduceRight"
1103+
external reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b = "reduceRight"
11041104

11051105
@send
11061106
/**
@@ -1116,7 +1116,7 @@ Js.Array2.some([3, 7, 5, 2, 9], isEven) == true
11161116
Js.Array2.some([3, 7, 5, 1, 9], isEven) == false
11171117
```
11181118
*/
1119-
external some: (t<'a>, @uncurry 'a => bool) => bool = "some"
1119+
external some: (t<'a>, 'a => bool) => bool = "some"
11201120

11211121
@send
11221122
/**
@@ -1139,7 +1139,7 @@ Js.Array2.somei(["ab", "cd", "ef", "gh"], sameLength) == true
11391139
Js.Array2.somei(["a", "bc", "def", "gh"], sameLength) == false
11401140
```
11411141
*/
1142-
external somei: (t<'a>, @uncurry ('a, int) => bool) => bool = "some"
1142+
external somei: (t<'a>, ('a, int) => bool) => bool = "some"
11431143

11441144
/* commented out until bs has a plan for iterators
11451145
external values : 'a t -> 'a array_iter = "" [@@send] (* ES2015 *)

js/src/js_promise.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type error
4444
*/
4545

4646
@new
47-
external make: ((@uncurry ~resolve: 'a => unit, ~reject: exn => unit) => unit) => promise<'a> =
47+
external make: ((~resolve: 'a => unit, ~reject: exn => unit) => unit) => promise<'a> =
4848
"Promise"
4949

5050
/* `make (fun resolve reject -> .. )` */
@@ -82,10 +82,10 @@ external all6: (
8282

8383
@val @scope("Promise") external race: array<promise<'a>> => promise<'a> = "race"
8484

85-
@bs.send.pipe(: promise<'a>) external then_: (@uncurry 'a => promise<'b>) => promise<'b> = "then"
85+
@bs.send.pipe(: promise<'a>) external then_: ('a => promise<'b>) => promise<'b> = "then"
8686

8787
@bs.send.pipe(: promise<'a>)
88-
external catch: (@uncurry error => promise<'a>) => promise<'a> = "catch"
88+
external catch: (error => promise<'a>) => promise<'a> = "catch"
8989
/* ` p|> catch handler`
9090
Note in JS the returned promise type is actually runtime dependent,
9191
if promise is rejected, it will pick the `handler` otherwise the original promise,

js/src/js_promise2.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let catch: (promise<'a>, error => promise<'a>) => promise<'a> = %raw(`
1616
`)
1717

1818
@new
19-
external make: ((@uncurry ~resolve: 'a => unit, ~reject: exn => unit) => unit) => promise<'a> =
19+
external make: ((~resolve: 'a => unit, ~reject: exn => unit) => unit) => promise<'a> =
2020
"Promise"
2121

2222
@val @scope("Promise") external resolve: 'a => promise<'a> = "resolve"

js/src/js_string2.res

+4-4
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ let matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(match
542542
Js.String2.unsafeReplaceBy0(str, re, matchFn) == "bEAUtIfUl vOwEls"
543543
```
544544
*/
545-
external unsafeReplaceBy0: (t, Js_re.t, @uncurry (t, int, t) => t) => t = "replace"
545+
external unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t = "replace"
546546

547547
@send
548548
/**
@@ -567,7 +567,7 @@ let matchFn = (_match, part1, _offset, _wholeString) => {
567567
Js.String2.unsafeReplaceBy1(str, re, matchFn) == "Jony is 41"
568568
```
569569
*/
570-
external unsafeReplaceBy1: (t, Js_re.t, @uncurry (t, t, int, t) => t) => t = "replace"
570+
external unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t = "replace"
571571

572572
@send
573573
/**
@@ -595,7 +595,7 @@ let matchFn = (_match, p1, p2, _offset, _wholeString) => {
595595
Js.String2.unsafeReplaceBy2(str, re, matchFn) == "42"
596596
```
597597
*/
598-
external unsafeReplaceBy2: (t, Js_re.t, @uncurry (t, t, t, int, t) => t) => t = "replace"
598+
external unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t = "replace"
599599

600600
@send
601601
/**
@@ -608,7 +608,7 @@ matched.
608608
See [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)
609609
on MDN.
610610
*/
611-
external unsafeReplaceBy3: (t, Js_re.t, @uncurry (t, t, t, t, int, t) => t) => t = "replace"
611+
external unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t = "replace"
612612

613613
@send
614614
/**

0 commit comments

Comments
 (0)