diff --git a/js/src/js_array.res b/js/src/js_array.res index ff469e9..1ea239d 100644 --- a/js/src/js_array.res +++ b/js/src/js_array.res @@ -99,7 +99,7 @@ let code = s => Js.String.charCodeAt(0, s) Js.Array.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0] ``` */ -external fromMap: (array_like<'a>, ('a => 'b)) => array<'b> = "Array.from" +external fromMap: (array_like<'a>, 'a => 'b) => array<'b> = "Array.from" /* ES2015 */ @@ -689,7 +689,7 @@ Js.Array.every(isEven, [6, 22, 8, 4]) == true Js.Array.every(isEven, [6, 22, 7, 4]) == false ``` */ -external every: (('a => bool)) => bool = "every" +external every: ('a => bool) => bool = "every" @send.pipe(: t<'a> as 'this) /** @@ -718,7 +718,7 @@ let nonEmpty = s => s != "" Js.Array.filter(nonEmpty, ["abc", "", "", "def", "ghi"]) == ["abc", "def", "ghi"] ``` */ -external filter: (('a => bool)) => 'this = "filter" +external filter: ('a => bool) => 'this = "filter" @send.pipe(: t<'a> as 'this) /** @@ -756,7 +756,7 @@ Js.Array.find(x => x < 0, [33, 22, -55, 77, -44]) == Some(-55) Js.Array.find(x => x < 0, [33, 22, 55, 77, 44]) == None ``` */ -external find: (('a => bool)) => option<'a> = "find" +external find: ('a => bool) => option<'a> = "find" @send.pipe(: t<'a> as 'this) @return(nullable) @@ -786,7 +786,7 @@ Js.Array.findIndex(x => x < 0, [33, 22, -55, 77, -44]) == 2 Js.Array.findIndex(x => x < 0, [33, 22, 55, 77, 44]) == -1 ``` */ -external findIndex: (('a => bool)) => int = "findIndex" +external findIndex: ('a => bool) => int = "findIndex" @send.pipe(: t<'a> as 'this) /** @@ -815,7 +815,7 @@ The `forEach()` function applies the function given as the first argument to eac Js.Array.forEach(x => Js.log(x), ["a", "b", "c"]) == () ``` */ -external forEach: (('a => unit)) => unit = "forEach" +external forEach: ('a => unit) => unit = "forEach" @send.pipe(: t<'a> as 'this) /** @@ -849,7 +849,7 @@ Js.Array.map(x => x * x, [12, 4, 8]) == [144, 16, 64] Js.Array.map(Js.String.length, ["animal", "vegetable", "mineral"]) == [6, 9, 7] ``` */ -external map: (('a => 'b)) => t<'b> = "map" +external map: ('a => 'b) => t<'b> = "map" @send.pipe(: t<'a> as 'this) /** @@ -1020,7 +1020,7 @@ Js.Array.some(isEven, [3, 7, 5, 2, 9]) == true Js.Array.some(isEven, [3, 7, 5, 1, 9]) == false ``` */ -external some: (('a => bool)) => bool = "some" +external some: ('a => bool) => bool = "some" @send.pipe(: t<'a> as 'this) /** diff --git a/js/src/js_array2.res b/js/src/js_array2.res index 2b40210..1666cf5 100644 --- a/js/src/js_array2.res +++ b/js/src/js_array2.res @@ -97,7 +97,7 @@ let code = s => Js.String.charCodeAt(0, s) Js.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0] ``` */ -external fromMap: (array_like<'a>, @uncurry ('a => 'b)) => array<'b> = "Array.from" +external fromMap: (array_like<'a>, 'a => 'b) => array<'b> = "Array.from" /* ES2015 */ @@ -399,7 +399,7 @@ let reverseNumeric = (n1, n2) => n2 - n1 Js.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1] ``` */ -external sortInPlaceWith: (t<'a>, @uncurry ('a, 'a) => int) => t<'a> = "sort" +external sortInPlaceWith: (t<'a>, ('a, 'a) => int) => t<'a> = "sort" @send @variadic @@ -740,7 +740,7 @@ Js.Array2.every([6, 22, 8, 4], isEven) == true Js.Array2.every([6, 22, 7, 4], isEven) == false ``` */ -external every: (t<'a>, @uncurry ('a => bool)) => bool = "every" +external every: (t<'a>, 'a => bool) => bool = "every" @send /** @@ -762,7 +762,7 @@ Js.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true Js.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false ``` */ -external everyi: (t<'a>, @uncurry ('a, int) => bool) => bool = "every" +external everyi: (t<'a>, ('a, int) => bool) => bool = "every" @send /** @@ -779,7 +779,7 @@ let nonEmpty = s => s != "" Js.Array2.filter(["abc", "", "", "def", "ghi"], nonEmpty) == ["abc", "def", "ghi"] ``` */ -external filter: (t<'a>, @uncurry ('a => bool)) => t<'a> = "filter" +external filter: (t<'a>, 'a => bool) => t<'a> = "filter" @send /** @@ -800,7 +800,7 @@ let positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0 Js.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8] ``` */ -external filteri: (t<'a>, @uncurry ('a, int) => bool) => t<'a> = "filter" +external filteri: (t<'a>, ('a, int) => bool) => t<'a> = "filter" @send @return({undefined_to_opt: undefined_to_opt}) @@ -818,7 +818,7 @@ Js.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55) Js.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None ``` */ -external find: (t<'a>, @uncurry ('a => bool)) => option<'a> = "find" +external find: (t<'a>, 'a => bool) => option<'a> = "find" /* ES2015 */ @@ -841,7 +841,7 @@ Js.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88) Js.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None ``` */ -external findi: (t<'a>, @uncurry ('a, int) => bool) => option<'a> = "find" +external findi: (t<'a>, ('a, int) => bool) => option<'a> = "find" /* ES2015 */ @@ -859,7 +859,7 @@ Js.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2 Js.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1 ``` */ -external findIndex: (t<'a>, @uncurry ('a => bool)) => int = "findIndex" +external findIndex: (t<'a>, 'a => bool) => int = "findIndex" /* ES2015 */ @@ -881,7 +881,7 @@ Js.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3 Js.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1 ``` */ -external findIndexi: (t<'a>, @uncurry ('a, int) => bool) => int = "findIndex" +external findIndexi: (t<'a>, ('a, int) => bool) => int = "findIndex" /* ES2015 */ @@ -902,7 +902,7 @@ on MDN. Js.Array2.forEach(["a", "b", "c"], x => Js.log(x)) == () ``` */ -external forEach: (t<'a>, @uncurry ('a => unit)) => unit = "forEach" +external forEach: (t<'a>, 'a => unit) => unit = "forEach" @send /** @@ -922,7 +922,7 @@ on MDN. Js.Array2.forEachi(["a", "b", "c"], (item, index) => Js.log2(index + 1, item)) == () ``` */ -external forEachi: (t<'a>, @uncurry ('a, int) => unit) => unit = "forEach" +external forEachi: (t<'a>, ('a, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators 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] Js.Array2.map(["animal", "vegetable", "mineral"], Js.String.length) == [6, 9, 7] ``` */ -external map: (t<'a>, @uncurry ('a => 'b)) => t<'b> = "map" +external map: (t<'a>, 'a => 'b) => t<'b> = "map" @send /** @@ -962,7 +962,7 @@ let product = (item, index) => item * index Js.Array2.mapi([10, 11, 12], product) == [0, 11, 24] ``` */ -external mapi: (t<'a>, @uncurry ('a, int) => 'b) => t<'b> = "map" +external mapi: (t<'a>, ('a, int) => 'b) => t<'b> = "map" @send /** @@ -996,7 +996,7 @@ Js.Array2.reduce( Js.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0) ``` */ -external reduce: (t<'a>, @uncurry ('b, 'a) => 'b, 'b) => 'b = "reduce" +external reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b = "reduce" @send /** @@ -1031,7 +1031,7 @@ let sumOfEvens = (accumulator, item, index) => Js.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6 ``` */ -external reducei: (t<'a>, @uncurry ('b, 'a, int) => 'b, 'b) => 'b = "reduce" +external reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b = "reduce" @send /** @@ -1063,7 +1063,7 @@ Js.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120 Js.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0) ``` */ -external reduceRight: (t<'a>, @uncurry ('b, 'a) => 'b, 'b) => 'b = "reduceRight" +external reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b = "reduceRight" @send /** @@ -1100,7 +1100,7 @@ let sumOfEvens = (accumulator, item, index) => Js.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6 ``` */ -external reduceRighti: (t<'a>, @uncurry ('b, 'a, int) => 'b, 'b) => 'b = "reduceRight" +external reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b = "reduceRight" @send /** @@ -1116,7 +1116,7 @@ Js.Array2.some([3, 7, 5, 2, 9], isEven) == true Js.Array2.some([3, 7, 5, 1, 9], isEven) == false ``` */ -external some: (t<'a>, @uncurry ('a => bool)) => bool = "some" +external some: (t<'a>, 'a => bool) => bool = "some" @send /** @@ -1139,7 +1139,7 @@ Js.Array2.somei(["ab", "cd", "ef", "gh"], sameLength) == true Js.Array2.somei(["a", "bc", "def", "gh"], sameLength) == false ``` */ -external somei: (t<'a>, @uncurry ('a, int) => bool) => bool = "some" +external somei: (t<'a>, ('a, int) => bool) => bool = "some" /* commented out until bs has a plan for iterators external values : 'a t -> 'a array_iter = "" [@@send] (* ES2015 *) diff --git a/js/src/js_dict.res b/js/src/js_dict.res index cd07c15..af8cb2d 100644 --- a/js/src/js_dict.res +++ b/js/src/js_dict.res @@ -60,7 +60,7 @@ external keys: t<'a> => array = "Object.keys" @obj external empty: unit => t<'a> = "" -let unsafeDeleteKey: (. t, string) => unit = %raw(` function (dict,key){ +let unsafeDeleteKey: (t, string) => unit = %raw(` function (dict,key){ delete dict[key]; } `) @@ -118,7 +118,7 @@ let map = (f, source) => { let l = Js_array2.length(keys) for i in 0 to l - 1 { let key = Js_array2.unsafe_get(keys, i) - set(target, key, f(. unsafeGet(source, key))) + set(target, key, f(unsafeGet(source, key))) } target } diff --git a/js/src/js_dict.resi b/js/src/js_dict.resi index 5f6a30f..8baa940 100644 --- a/js/src/js_dict.resi +++ b/js/src/js_dict.resi @@ -107,7 +107,7 @@ external keys: t<'a> => array = "Object.keys" external empty: unit => t<'a> = "" /** Experimental internal function */ -let unsafeDeleteKey: (. t, string) => unit +let unsafeDeleteKey: (t, string) => unit /** Returns an array of key/value pairs in the given dictionary (ES2017). @@ -170,4 +170,4 @@ let salePrices = Js.Dict.map(discount, prices) salePrices == Js.Dict.fromList(list{("pen", 0.90), ("book", 4.50), ("stapler", 6.30)}) ``` */ -let map: ((. 'a) => 'b, t<'a>) => t<'b> +let map: ('a => 'b, t<'a>) => t<'b> diff --git a/js/src/js_list.res b/js/src/js_list.res index 72c66b5..8580e6e 100644 --- a/js/src/js_list.res +++ b/js/src/js_list.res @@ -78,7 +78,7 @@ let rev = l => revAppend(l, list{}) let rec mapRevAux = (f, acc, ls) => switch ls { | list{} => acc - | list{a, ...l} => mapRevAux(f, list{f(. a), ...acc}, l) + | list{a, ...l} => mapRevAux(f, list{f(a), ...acc}, l) } let mapRev = (f, ls) => mapRevAux(f, list{}, ls) @@ -89,7 +89,7 @@ let rec iter = (f, x) => switch x { | list{} => () | list{a, ...l} => - f(. a) + f(a) iter(f, l) } @@ -97,7 +97,7 @@ let rec iteri = (i, f, x) => switch x { | list{} => () | list{a, ...l} => - f(. i, a) + f(i, a) iteri(i + 1, f, l) } @@ -106,7 +106,7 @@ let iteri = (f, l) => iteri(0, f, l) let rec foldLeft = (f, accu, l) => switch l { | list{} => accu - | list{a, ...l} => foldLeft(f, f(. accu, a), l) + | list{a, ...l} => foldLeft(f, f(accu, a), l) } let foldRightMaxStack = 1000 @@ -114,7 +114,7 @@ let foldRightMaxStack = 1000 let rec tailLoop = (f, acc, x) => switch x { | list{} => acc - | list{h, ...t} => tailLoop(f, f(. h, acc), t) + | list{h, ...t} => tailLoop(f, f(h, acc), t) } let foldRight = (f, l, init) => { @@ -123,9 +123,9 @@ let foldRight = (f, l, init) => { | list{} => init | list{h, ...t} => if n < foldRightMaxStack { - f(. h, loop(n + 1, t)) + f(h, loop(n + 1, t)) } else { - f(. h, tailLoop(f, init, rev(t))) + f(h, tailLoop(f, init, rev(t))) } } @@ -144,7 +144,7 @@ let rec filterRevAux = (f, acc, xs) => switch xs { | list{} => acc | list{y, ...ys} => - switch f(. y) { + switch f(y) { | false => filterRevAux(f, acc, ys) | true => filterRevAux(f, list{y, ...acc}, ys) } @@ -152,11 +152,11 @@ let rec filterRevAux = (f, acc, xs) => let filter = (f, xs) => rev(filterRevAux(f, list{}, xs)) -let rec filterMapRevAux = (f: (. 'a) => option<'b>, acc, xs) => +let rec filterMapRevAux = (f: 'a => option<'b>, acc, xs) => switch xs { | list{} => acc | list{y, ...ys} => - switch f(. y) { + switch f(y) { | None => filterMapRevAux(f, acc, ys) | Some(z) => filterMapRevAux(f, list{z, ...acc}, ys) } @@ -170,7 +170,7 @@ let rec countByAux = (f, acc, xs) => | list{y, ...ys} => countByAux( f, - if f(. y) { + if f(y) { acc + 1 } else { acc @@ -204,7 +204,7 @@ let rec equal = (cmp, xs, ys) => switch (xs, ys) { | (list{}, list{}) => true | (list{x, ...xs}, list{y, ...ys}) => - if cmp(. x, y) { + if cmp(x, y) { equal(cmp, xs, ys) } else { false diff --git a/js/src/js_list.resi b/js/src/js_list.resi index d4c9efa..4588d37 100644 --- a/js/src/js_list.resi +++ b/js/src/js_list.resi @@ -42,30 +42,30 @@ let revAppend: (t<'a>, t<'a>) => t<'a> let rev: t<'a> => t<'a> -let mapRev: ((. 'a) => 'b, t<'a>) => t<'b> +let mapRev: ('a => 'b, t<'a>) => t<'b> -let map: ((. 'a) => 'b, t<'a>) => t<'b> +let map: ('a => 'b, t<'a>) => t<'b> -let iter: ((. 'a) => unit, t<'a>) => unit +let iter: ('a => unit, t<'a>) => unit -let iteri: ((. int, 'a) => unit, t<'a>) => unit +let iteri: ((int, 'a) => unit, t<'a>) => unit /** Application order is left to right, tail recurisve */ -let foldLeft: ((. 'a, 'b) => 'a, 'a, list<'b>) => 'a +let foldLeft: (('a, 'b) => 'a, 'a, list<'b>) => 'a /** Application order is right to left tail-recursive. */ -let foldRight: ((. 'a, 'b) => 'b, list<'a>, 'b) => 'b +let foldRight: (('a, 'b) => 'b, list<'a>, 'b) => 'b let flatten: t> => t<'a> -let filter: ((. 'a) => bool, t<'a>) => t<'a> +let filter: ('a => bool, t<'a>) => t<'a> -let filterMap: ((. 'a) => option<'b>, t<'a>) => t<'b> +let filterMap: ('a => option<'b>, t<'a>) => t<'b> -let countBy: ((. 'a) => bool, list<'a>) => int +let countBy: ('a => bool, list<'a>) => int -let init: (int, (. int) => 'a) => t<'a> +let init: (int, int => 'a) => t<'a> let toVector: t<'a> => array<'a> -let equal: ((. 'a, 'a) => bool, list<'a>, list<'a>) => bool +let equal: (('a, 'a) => bool, list<'a>, list<'a>) => bool diff --git a/js/src/js_log.res b/js/src/js_log.res index 94759ec..c70ec6b 100644 --- a/js/src/js_log.res +++ b/js/src/js_log.res @@ -1,5 +1,6 @@ /** Equivalent to console.log any value */ -@val @scope("console") +@val +@scope("console") external log: 'a => unit = "log" @val @scope("console") @@ -12,5 +13,7 @@ external log3: 'a => 'b => 'c => unit = "log" external log4: 'a => 'b => 'c => 'd => unit = "log" /** A convenience function to console.log more than 4 arguments */ -@val @scope("console") @variadic +@val +@scope("console") +@variadic external logMany: array<'a> => unit = "log" diff --git a/js/src/js_null_undefined.res b/js/src/js_null_undefined.res index 0e02084..9918684 100644 --- a/js/src/js_null_undefined.res +++ b/js/src/js_null_undefined.res @@ -40,13 +40,13 @@ external undefined: t<'a> = "#undefined" let bind = (x, f) => switch to_opt(x) { | None => (Obj.magic((x: t<'a>)): t<'b>) - | Some(x) => return(f(. x)) + | Some(x) => return(f(x)) } let iter = (x, f) => switch to_opt(x) { | None => () - | Some(x) => f(. x) + | Some(x) => f(x) } let fromOption = x => diff --git a/js/src/js_null_undefined.resi b/js/src/js_null_undefined.resi index 93188be..e51894c 100644 --- a/js/src/js_null_undefined.resi +++ b/js/src/js_null_undefined.resi @@ -59,7 +59,7 @@ let maybeGreetWorld = (maybeGreeting: Js.null_undefined) => Js.Null_undefined.bind(maybeGreeting, (. greeting) => greeting ++ " world!") ``` */ -let bind: (t<'a>, (. 'a) => 'b) => t<'b> +let bind: (t<'a>, 'a => 'b) => t<'b> /** Iterates over the contained value with the given function. @@ -72,7 +72,7 @@ let maybeSay = (maybeMessage: Js.null_undefined) => Js.Null_undefined.iter(maybeMessage, (. message) => Js.log(message)) ``` */ -let iter: (t<'a>, (. 'a) => unit) => unit +let iter: (t<'a>, 'a => unit) => unit /** Maps `option<'a>` to `Js.null_undefined<'a>`. diff --git a/js/src/js_option.res b/js/src/js_option.res index d18e815..8cb8074 100644 --- a/js/src/js_option.res +++ b/js/src/js_option.res @@ -70,7 +70,7 @@ Js.Option.isSomeValue(clockEqual, 3, None) == false let isSomeValue = (eq, v, x) => switch x { | None => false - | Some(x) => eq(. v, x) + | Some(x) => eq(v, x) } /** Returns `true` if the argument is `None`; `false` otherwise. */ @@ -119,7 +119,7 @@ let equal = (eq, a, b) => | Some(x) => switch b { | None => false - | Some(y) => eq(. x, y) + | Some(y) => eq(x, y) } } @@ -141,7 +141,7 @@ Js.Option.andThen(reciprocal, None) == None let andThen = (f, x) => switch x { | None => None - | Some(x) => f(. x) + | Some(x) => f(x) } /** @@ -161,7 +161,7 @@ Js.Option.map(square, None) == None let map = (f, x) => switch x { | None => None - | Some(x) => Some(f(. x)) + | Some(x) => Some(f(x)) } /** @@ -205,7 +205,7 @@ let filter = (f, x) => switch x { | None => None | Some(x) => - if f(. x) { + if f(x) { Some(x) } else { None diff --git a/js/src/js_option.resi b/js/src/js_option.resi index dca50e3..8a5f6f0 100644 --- a/js/src/js_option.resi +++ b/js/src/js_option.resi @@ -28,23 +28,23 @@ let some: 'a => option<'a> let isSome: option<'a> => bool -let isSomeValue: ((. 'a, 'a) => bool, 'a, option<'a>) => bool +let isSomeValue: (('a, 'a) => bool, 'a, option<'a>) => bool let isNone: option<'a> => bool let getExn: option<'a> => 'a -let equal: ((. 'a, 'b) => bool, option<'a>, option<'b>) => bool +let equal: (('a, 'b) => bool, option<'a>, option<'b>) => bool -let andThen: ((. 'a) => option<'b>, option<'a>) => option<'b> +let andThen: ('a => option<'b>, option<'a>) => option<'b> -let map: ((. 'a) => 'b, option<'a>) => option<'b> +let map: ('a => 'b, option<'a>) => option<'b> let getWithDefault: ('a, option<'a>) => 'a @deprecated("Use `getWithDefault` instead since default has special meaning in ES module") let default: ('a, option<'a>) => 'a -let filter: ((. 'a) => bool, option<'a>) => option<'a> +let filter: ('a => bool, option<'a>) => option<'a> let firstSome: (option<'a>, option<'a>) => option<'a> diff --git a/js/src/js_promise.res b/js/src/js_promise.res index 7268e1e..ee69304 100644 --- a/js/src/js_promise.res +++ b/js/src/js_promise.res @@ -44,9 +44,8 @@ type error */ @new -external make: ((@uncurry ~resolve: (. 'a) => unit, ~reject: (. exn) => unit) => unit) => promise< - 'a, -> = "Promise" +external make: ((~resolve: 'a => unit, ~reject: exn => unit) => unit) => promise<'a> = + "Promise" /* `make (fun resolve reject -> .. )` */ @val @scope("Promise") external resolve: 'a => promise<'a> = "resolve" @@ -83,10 +82,10 @@ external all6: ( @val @scope("Promise") external race: array> => promise<'a> = "race" -@bs.send.pipe(: promise<'a>) external then_: (@uncurry ('a => promise<'b>)) => promise<'b> = "then" +@bs.send.pipe(: promise<'a>) external then_: ('a => promise<'b>) => promise<'b> = "then" @bs.send.pipe(: promise<'a>) -external catch: (@uncurry (error => promise<'a>)) => promise<'a> = "catch" +external catch: (error => promise<'a>) => promise<'a> = "catch" /* ` p|> catch handler` Note in JS the returned promise type is actually runtime dependent, if promise is rejected, it will pick the `handler` otherwise the original promise, diff --git a/js/src/js_promise2.res b/js/src/js_promise2.res index 4fa6778..797318b 100644 --- a/js/src/js_promise2.res +++ b/js/src/js_promise2.res @@ -16,9 +16,8 @@ let catch: (promise<'a>, error => promise<'a>) => promise<'a> = %raw(` `) @new -external make: ((@uncurry ~resolve: (. 'a) => unit, ~reject: (. exn) => unit) => unit) => promise< - 'a, -> = "Promise" +external make: ((~resolve: 'a => unit, ~reject: exn => unit) => unit) => promise<'a> = + "Promise" @val @scope("Promise") external resolve: 'a => promise<'a> = "resolve" @val @scope("Promise") external reject: exn => promise<'a> = "reject" diff --git a/js/src/js_string2.res b/js/src/js_string2.res index 7dd51fd..3034657 100644 --- a/js/src/js_string2.res +++ b/js/src/js_string2.res @@ -542,7 +542,7 @@ let matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(match Js.String2.unsafeReplaceBy0(str, re, matchFn) == "bEAUtIfUl vOwEls" ``` */ -external unsafeReplaceBy0: (t, Js_re.t, @uncurry (t, int, t) => t) => t = "replace" +external unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t = "replace" @send /** @@ -567,7 +567,7 @@ let matchFn = (_match, part1, _offset, _wholeString) => { Js.String2.unsafeReplaceBy1(str, re, matchFn) == "Jony is 41" ``` */ -external unsafeReplaceBy1: (t, Js_re.t, @uncurry (t, t, int, t) => t) => t = "replace" +external unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t = "replace" @send /** @@ -595,7 +595,7 @@ let matchFn = (_match, p1, p2, _offset, _wholeString) => { Js.String2.unsafeReplaceBy2(str, re, matchFn) == "42" ``` */ -external unsafeReplaceBy2: (t, Js_re.t, @uncurry (t, t, t, int, t) => t) => t = "replace" +external unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t = "replace" @send /** @@ -608,7 +608,7 @@ matched. See [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN. */ -external unsafeReplaceBy3: (t, Js_re.t, @uncurry (t, t, t, t, int, t) => t) => t = "replace" +external unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t = "replace" @send /** diff --git a/js/src/js_typed_array.res b/js/src/js_typed_array.res index 45e865c..d4bb502 100644 --- a/js/src/js_typed_array.res +++ b/js/src/js_typed_array.res @@ -96,7 +96,7 @@ module type S = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @@ -128,38 +128,38 @@ module type S = { external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" /** should we use `bool` or `boolean` seems they are intechangeable here */ @bs.send.pipe(: t) - external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" /* commented out until bs has a plan for iterators external values : elt array_iter = "" [@@bs.send.pipe: t] @@ -203,7 +203,7 @@ module Int8Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -235,36 +235,36 @@ module Int8Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Int8Array.BYTES_PER_ELEMENT" @@ -326,7 +326,7 @@ module Uint8Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -358,36 +358,36 @@ module Uint8Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint8Array.BYTES_PER_ELEMENT" @@ -395,8 +395,7 @@ module Uint8Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint8Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes @@ -449,7 +448,7 @@ module Uint8ClampedArray = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -481,36 +480,36 @@ module Uint8ClampedArray = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint8ClampedArray.BYTES_PER_ELEMENT" @@ -572,7 +571,7 @@ module Int16Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -604,36 +603,36 @@ module Int16Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Int16Array.BYTES_PER_ELEMENT" @@ -641,8 +640,7 @@ module Int16Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Int16Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes @@ -695,7 +693,7 @@ module Uint16Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -727,36 +725,36 @@ module Uint16Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint16Array.BYTES_PER_ELEMENT" @@ -764,8 +762,7 @@ module Uint16Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint16Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes @@ -818,7 +815,7 @@ module Int32Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -850,36 +847,36 @@ module Int32Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Int32Array.BYTES_PER_ELEMENT" @@ -887,8 +884,7 @@ module Int32Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Int32Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes @@ -944,7 +940,7 @@ module Uint32Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -976,36 +972,36 @@ module Uint32Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint32Array.BYTES_PER_ELEMENT" @@ -1013,8 +1009,7 @@ module Uint32Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint32Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes @@ -1070,7 +1065,7 @@ module Float32Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -1102,36 +1097,36 @@ module Float32Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Float32Array.BYTES_PER_ELEMENT" @@ -1139,8 +1134,7 @@ module Float32Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Float32Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes @@ -1197,7 +1191,7 @@ module Float64Array = { @bs.send.pipe(: t) external reverseInPlace: t = "reverse" @bs.send.pipe(: t) external sortInPlace: t = "sort" - @bs.send.pipe(: t) external sortInPlaceWith: ((. elt, elt) => int) => t = "sort" + @bs.send.pipe(: t) external sortInPlaceWith: ((elt, elt) => int) => t = "sort" /* Accessor functions */ @bs.send.pipe(: t) external includes: elt => bool = "includes" /* ES2016 */ @@ -1229,36 +1223,36 @@ module Float64Array = { /* commented out until bs has a plan for iterators external entries : (int * elt) array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external every: ((. elt) => bool) => bool = "every" - @bs.send.pipe(: t) external everyi: ((. elt, int) => bool) => bool = "every" + @bs.send.pipe(: t) external every: (elt => bool) => bool = "every" + @bs.send.pipe(: t) external everyi: ((elt, int) => bool) => bool = "every" - @bs.send.pipe(: t) external filter: ((. elt) => bool) => t = "filter" - @bs.send.pipe(: t) external filteri: ((. elt, int) => bool) => t = "filter" + @bs.send.pipe(: t) external filter: (elt => bool) => t = "filter" + @bs.send.pipe(: t) external filteri: ((elt, int) => bool) => t = "filter" - @bs.send.pipe(: t) external find: ((. elt) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findi: ((. elt, int) => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external find: (elt => bool) => Js_undefined.t = "find" + @bs.send.pipe(: t) external findi: ((elt, int) => bool) => Js_undefined.t = "find" - @bs.send.pipe(: t) external findIndex: ((. elt) => bool) => int = "findIndex" - @bs.send.pipe(: t) external findIndexi: ((. elt, int) => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndex: (elt => bool) => int = "findIndex" + @bs.send.pipe(: t) external findIndexi: ((elt, int) => bool) => int = "findIndex" - @bs.send.pipe(: t) external forEach: ((. elt) => unit) => unit = "forEach" - @bs.send.pipe(: t) external forEachi: ((. elt, int) => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEach: (elt => unit) => unit = "forEach" + @bs.send.pipe(: t) external forEachi: ((elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : int array_iter = "" [@@bs.send.pipe: t] */ - @bs.send.pipe(: t) external map: ((. elt) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external mapi: ((. elt, int) => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external map: (elt => 'b) => typed_array<'b> = "map" + @bs.send.pipe(: t) external mapi: ((elt, int) => 'b) => typed_array<'b> = "map" - @bs.send.pipe(: t) external reduce: ((. 'b, elt) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reducei: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reduce: (('b, elt) => 'b, 'b) => 'b = "reduce" + @bs.send.pipe(: t) external reducei: (('b, elt, int) => 'b, 'b) => 'b = "reduce" - @bs.send.pipe(: t) external reduceRight: ((. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external reduceRighti: ((. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRight: (('b, elt) => 'b, 'b) => 'b = "reduceRight" + @bs.send.pipe(: t) external reduceRighti: (('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @bs.send.pipe(: t) external some: ((. elt) => bool) => bool = "some" - @bs.send.pipe(: t) external somei: ((. elt, int) => bool) => bool = "some" + @bs.send.pipe(: t) external some: (elt => bool) => bool = "some" + @bs.send.pipe(: t) external somei: ((elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Float64Array.BYTES_PER_ELEMENT" @@ -1266,8 +1260,7 @@ module Float64Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Float64Array" - @new - /** + @new /** **raise** Js.Exn.Error raise Js exception **param** offset is in bytes diff --git a/js/src/js_typed_array2.res b/js/src/js_typed_array2.res index d4bdc68..c6f3d55 100644 --- a/js/src/js_typed_array2.res +++ b/js/src/js_typed_array2.res @@ -91,7 +91,7 @@ module Int8Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -123,36 +123,36 @@ module Int8Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Int8Array.BYTES_PER_ELEMENT" @@ -160,8 +160,7 @@ module Int8Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Int8Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -213,7 +212,7 @@ module Uint8Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -245,36 +244,36 @@ module Uint8Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint8Array.BYTES_PER_ELEMENT" @@ -282,8 +281,7 @@ module Uint8Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint8Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -335,7 +333,7 @@ module Uint8ClampedArray = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -367,36 +365,36 @@ module Uint8ClampedArray = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint8ClampedArray.BYTES_PER_ELEMENT" @@ -404,8 +402,7 @@ module Uint8ClampedArray = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint8ClampedArray" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -457,7 +454,7 @@ module Int16Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -489,36 +486,36 @@ module Int16Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Int16Array.BYTES_PER_ELEMENT" @@ -526,8 +523,7 @@ module Int16Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Int16Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -579,7 +575,7 @@ module Uint16Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -611,36 +607,36 @@ module Uint16Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint16Array.BYTES_PER_ELEMENT" @@ -648,8 +644,7 @@ module Uint16Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint16Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -701,7 +696,7 @@ module Int32Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -733,36 +728,36 @@ module Int32Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Int32Array.BYTES_PER_ELEMENT" @@ -770,8 +765,7 @@ module Int32Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Int32Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -823,7 +817,7 @@ module Uint32Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -855,36 +849,36 @@ module Uint32Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Uint32Array.BYTES_PER_ELEMENT" @@ -892,8 +886,7 @@ module Uint32Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Uint32Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -948,7 +941,7 @@ module Float32Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -980,36 +973,36 @@ module Float32Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Float32Array.BYTES_PER_ELEMENT" @@ -1017,8 +1010,7 @@ module Float32Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Float32Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes @@ -1070,7 +1062,7 @@ module Float64Array = { @send external reverseInPlace: t => t = "reverse" @send external sortInPlace: t => t = "sort" - @send external sortInPlaceWith: (t, (. elt, elt) => int) => t = "sort" + @send external sortInPlaceWith: (t, (elt, elt) => int) => t = "sort" /* Accessor functions */ @send external includes: (t, elt) => bool = "includes" /* ES2016 */ @@ -1102,36 +1094,36 @@ module Float64Array = { /* commented out until bs has a plan for iterators external entries : t -> (int * elt) array_iter = "" [@@send] */ - @send external every: (t, (. elt) => bool) => bool = "every" - @send external everyi: (t, (. elt, int) => bool) => bool = "every" + @send external every: (t, elt => bool) => bool = "every" + @send external everyi: (t, (elt, int) => bool) => bool = "every" - @send external filter: (t, (. elt) => bool) => t = "filter" - @send external filteri: (t, (. elt, int) => bool) => t = "filter" + @send external filter: (t, elt => bool) => t = "filter" + @send external filteri: (t, (elt, int) => bool) => t = "filter" - @send external find: (t, (. elt) => bool) => Js_undefined.t = "find" - @send external findi: (t, (. elt, int) => bool) => Js_undefined.t = "find" + @send external find: (t, elt => bool) => Js_undefined.t = "find" + @send external findi: (t, (elt, int) => bool) => Js_undefined.t = "find" - @send external findIndex: (t, (. elt) => bool) => int = "findIndex" - @send external findIndexi: (t, (. elt, int) => bool) => int = "findIndex" + @send external findIndex: (t, elt => bool) => int = "findIndex" + @send external findIndexi: (t, (elt, int) => bool) => int = "findIndex" - @send external forEach: (t, (. elt) => unit) => unit = "forEach" - @send external forEachi: (t, (. elt, int) => unit) => unit = "forEach" + @send external forEach: (t, elt => unit) => unit = "forEach" + @send external forEachi: (t, (elt, int) => unit) => unit = "forEach" /* commented out until bs has a plan for iterators external keys : t -> int array_iter = "" [@@send] */ - @send external map: (t, (. elt) => 'b) => typed_array<'b> = "map" - @send external mapi: (t, (. elt, int) => 'b) => typed_array<'b> = "map" + @send external map: (t, elt => 'b) => typed_array<'b> = "map" + @send external mapi: (t, (elt, int) => 'b) => typed_array<'b> = "map" - @send external reduce: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduce" - @send external reducei: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduce" + @send external reduce: (t, ('b, elt) => 'b, 'b) => 'b = "reduce" + @send external reducei: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduce" - @send external reduceRight: (t, (. 'b, elt) => 'b, 'b) => 'b = "reduceRight" - @send external reduceRighti: (t, (. 'b, elt, int) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRight: (t, ('b, elt) => 'b, 'b) => 'b = "reduceRight" + @send external reduceRighti: (t, ('b, elt, int) => 'b, 'b) => 'b = "reduceRight" - @send external some: (t, (. elt) => bool) => bool = "some" - @send external somei: (t, (. elt, int) => bool) => bool = "some" + @send external some: (t, elt => bool) => bool = "some" + @send external somei: (t, (elt, int) => bool) => bool = "some" @val external _BYTES_PER_ELEMENT: int = "Float64Array.BYTES_PER_ELEMENT" @@ -1139,8 +1131,7 @@ module Float64Array = { @new /** can throw */ external fromBuffer: array_buffer => t = "Float64Array" - @new - /** + @new /** **raise** Js_Exn.Error raise Js exception **param** offset is in bytes diff --git a/js/src/js_vector.res b/js/src/js_vector.res index 15b1ff0..568e803 100644 --- a/js/src/js_vector.res +++ b/js/src/js_vector.res @@ -41,7 +41,7 @@ let filterInPlace = (p, a) => { let j = ref(0) while i.contents < Js_array2.length(a) { let v = Js_array2.unsafe_get(a, i.contents) - if p(. v) { + if p(v) { Js_array2.unsafe_set(a, j.contents, v) j.contents = j.contents + 1 } @@ -59,12 +59,12 @@ let memByRef = (x, xs) => Js_array2.indexOf(xs, x) >= 0 let iter = (f, xs) => for i in 0 to Js_array2.length(xs) - 1 { - f(. Js_array2.unsafe_get(xs, i)) + f(Js_array2.unsafe_get(xs, i)) } let iteri = (f, a) => for i in 0 to length(a) - 1 { - f(. i, unsafe_get(a, i)) + f(i, unsafe_get(a, i)) } @new external createUnsafe: int => t<'a> = "Array" @@ -92,7 +92,7 @@ let toList = a => { let init = (n, f) => { let v = createUnsafe(n) for i in 0 to n - 1 { - unsafe_set(v, i, f(. i)) + unsafe_set(v, i, f(i)) } v } @@ -110,7 +110,7 @@ let map = (f, a) => { let l = Js_array2.length(a) let r = createUnsafe(l) for i in 0 to l - 1 { - unsafe_set(r, i, f(. unsafe_get(a, i))) + unsafe_set(r, i, f(unsafe_get(a, i))) } r } @@ -118,7 +118,7 @@ let map = (f, a) => { let foldLeft = (f, x, a) => { let r = ref(x) for i in 0 to length(a) - 1 { - r.contents = f(. r.contents, unsafe_get(a, i)) + r.contents = f(r.contents, unsafe_get(a, i)) } r.contents } @@ -126,7 +126,7 @@ let foldLeft = (f, x, a) => { let foldRight = (f, a, x) => { let r = ref(x) for i in length(a) - 1 downto 0 { - r.contents = f(. unsafe_get(a, i), r.contents) + r.contents = f(unsafe_get(a, i), r.contents) } r.contents } @@ -138,7 +138,7 @@ let mapi = (f, a) => { } else { let r = createUnsafe(l) for i in 0 to l - 1 { - unsafe_set(r, i, f(. i, unsafe_get(a, i))) + unsafe_set(r, i, f(i, unsafe_get(a, i))) } r } diff --git a/js/src/js_vector.resi b/js/src/js_vector.resi index 6218e9a..b36045c 100644 --- a/js/src/js_vector.resi +++ b/js/src/js_vector.resi @@ -26,7 +26,7 @@ type t<'a> = array<'a> -let filterInPlace: ((. 'a) => bool, t<'a>) => unit +let filterInPlace: ('a => bool, t<'a>) => unit let empty: t<'a> => unit let pushBack: ('a, t<'a>) => unit @@ -34,8 +34,8 @@ let pushBack: ('a, t<'a>) => unit let copy: t<'a> => t<'a> let memByRef: ('a, t<'a>) => bool -let iter: ((. 'a) => unit, t<'a>) => unit -let iteri: ((. int, 'a) => unit, t<'a>) => unit +let iter: ('a => unit, t<'a>) => unit +let iteri: ((int, 'a) => unit, t<'a>) => unit /* [@@deprecated "Use Js.List.toVector instead"] */ /* val ofList : 'a list -> 'a t */ @@ -43,10 +43,10 @@ let iteri: ((. int, 'a) => unit, t<'a>) => unit */ let toList: t<'a> => list<'a> -let map: ((. 'a) => 'b, t<'a>) => t<'b> -let mapi: ((. int, 'a) => 'b, t<'a>) => t<'b> -let foldLeft: ((. 'a, 'b) => 'a, 'a, t<'b>) => 'a -let foldRight: ((. 'b, 'a) => 'a, t<'b>, 'a) => 'a +let map: ('a => 'b, t<'a>) => t<'b> +let mapi: ((int, 'a) => 'b, t<'a>) => t<'b> +let foldLeft: (('a, 'b) => 'a, 'a, t<'b>) => 'a +let foldRight: (('b, 'a) => 'a, t<'b>, 'a) => 'a /** Return the length (number of elements) of the given array. */ external length: t<'a> => int = "%array_length" @@ -83,7 +83,7 @@ external make: (int, 'a) => t<'a> = "?make_vect" Raises `RangeError` when n is negative. n : size */ -let init: (int, (. int) => 'a) => t<'a> +let init: (int, int => 'a) => t<'a> /** `append(x, a)` returns a fresh vector with `x` appended to `a`. */ let append: ('a, t<'a>) => t<'a> diff --git a/js/src/jsxDOM.res b/js/src/jsxDOM.res index b2fc927..e474be3 100644 --- a/js/src/jsxDOM.res +++ b/js/src/jsxDOM.res @@ -208,7 +208,7 @@ type domProps = { kind?: string /* has a fixed set of possible values */, label?: string, list?: string, - loading?: [#"lazy" | #eager], + loading?: [#lazy | #eager], loop?: bool, low?: int, manifest?: string /* uri */, diff --git a/package.json b/package.json index e576599..f29bbdf 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,9 @@ "start": "rewatch watch", "build": "rewatch", "watch": "rewatch watch", - "clean": "rewatch clean" + "clean": "rewatch clean", + "format": "rescript format */src/*.res */src/*.resi", + "formatCheck": "rescript format -check */src/*.res */src/*.resi" }, "devDependencies": { "@rolandpeelen/rewatch": "^1.0.8" diff --git a/primitives/src/caml_exceptions.res b/primitives/src/caml_exceptions.res index 796e817..07896a7 100644 --- a/primitives/src/caml_exceptions.res +++ b/primitives/src/caml_exceptions.res @@ -24,7 +24,7 @@ module Map = { type t<'k, 'v> - + @new external make: unit => t<'k, 'v> = "Map" @send external set: (t<'k, 'v>, 'k, 'v) => unit = "set" @@ -45,12 +45,12 @@ let idMap: Map.t = Map.make() let create = (str: string): string => { let id = switch idMap->Map.get(str) { - | Some(v) => { + | Some(v) => { let id = v + 1 idMap->Map.set(str, id) id } - | None => { + | None => { let id = 1 idMap->Map.set(str, id) id diff --git a/primitives/src/caml_external_polyfill.res b/primitives/src/caml_external_polyfill.res index 38382a9..0a5b9a0 100644 --- a/primitives/src/caml_external_polyfill.res +++ b/primitives/src/caml_external_polyfill.res @@ -23,7 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ type global -let getGlobalThis: (. unit) => global = %raw(` function(){ +let getGlobalThis: unit => global = %raw(` function(){ if (typeof globalThis !== 'undefined') return globalThis; if (typeof self !== 'undefined') return self; if (typeof window !== 'undefined') return window; @@ -33,7 +33,7 @@ let getGlobalThis: (. unit) => global = %raw(` function(){ }`) type dyn -let resolve: (. string) => dyn = %raw(`function(s){ +let resolve: string => dyn = %raw(`function(s){ var myGlobal = getGlobalThis(); if (myGlobal[s] === undefined){ throw new Error(s + " not polyfilled by ReScript yet\n") diff --git a/primitives/src/caml_hash.res b/primitives/src/caml_hash.res index b33bedb..ae67533 100644 --- a/primitives/src/caml_hash.res +++ b/primitives/src/caml_hash.res @@ -141,7 +141,7 @@ let hash = (count: int, _limit, seed: int, obj: Obj.t): int => { ++ size } return size - }`)(.obj, (. v) => push_back(queue, v)) + }`)(obj, v => push_back(queue, v)) s.contents = hash_mix_int(s.contents, lor(lsl(size, 10), 0)) /* tag */ } }