diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0bd5a9..344639a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Change `Iterator` bindings to have the same shape as `AsyncIterator` for consistency. https://github.com/rescript-association/rescript-core/pull/34 - Add `Iterator.toArray` binding for turning an iterator into an array. https://github.com/rescript-association/rescript-core/pull/34 - Add `Array.at` binding for returning an array item by its index. https://github.com/rescript-association/rescript-core/pull/48 +- Fixed type signatures of `Array.fromArrayLikeWithMap` and `Array.fromIteratorWithMap`. https://github.com/rescript-association/rescript-core/pull/50 ### Documentation diff --git a/src/Core__Array.res b/src/Core__Array.res index c268bf71..43d80d2d 100644 --- a/src/Core__Array.res +++ b/src/Core__Array.res @@ -6,10 +6,10 @@ external setUnsafe: (array<'a>, int, 'a) => unit = "%array_unsafe_set" @val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from" @val -external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'a> = "Array.from" +external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b> = "Array.from" @val external fromIterator: Core__Iterator.t<'a> => array<'a> = "Array.from" -@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'c) => array<'a> = "Array.from" +@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'b) => array<'b> = "Array.from" @val external isArray: 'a => bool = "Array.isArray" diff --git a/src/Core__Array.resi b/src/Core__Array.resi index d9add930..268faca4 100644 --- a/src/Core__Array.resi +++ b/src/Core__Array.resi @@ -2,9 +2,9 @@ @val external fromWithMap: ('a, 'b => 'c) => array<'c> = "Array.from" @val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from" @val -external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'a> = "Array.from" +external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b> = "Array.from" @val external fromIterator: Core__Iterator.t<'a> => array<'a> = "Array.from" -@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'c) => array<'a> = "Array.from" +@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'b) => array<'b> = "Array.from" @val external isArray: 'a => bool = "Array.isArray" @get external length: array<'a> => int = "length" @send external copyAllWithin: (array<'a>, ~target: int) => array<'a> = "copyWithin"