From e282214daa6bf5c3fa7a5f934c31e4b345467ad2 Mon Sep 17 00:00:00 2001 From: glennsl Date: Sat, 18 Feb 2023 16:24:40 +0100 Subject: [PATCH 1/3] fix(array): wrong type signature for fromArrayLikeWithMap --- src/Core__Array.res | 2 +- src/Core__Array.resi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core__Array.res b/src/Core__Array.res index c268bf71..75a2de8a 100644 --- a/src/Core__Array.res +++ b/src/Core__Array.res @@ -6,7 +6,7 @@ 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" diff --git a/src/Core__Array.resi b/src/Core__Array.resi index d9add930..c505adb0 100644 --- a/src/Core__Array.resi +++ b/src/Core__Array.resi @@ -2,7 +2,7 @@ @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 isArray: 'a => bool = "Array.isArray" From 03a530697532639dadfaa7168d53a244f7f81fe9 Mon Sep 17 00:00:00 2001 From: glennsl Date: Sat, 18 Feb 2023 16:25:25 +0100 Subject: [PATCH 2/3] fix(array): wrong type signature for fromIteratorWithMap --- src/Core__Array.res | 2 +- src/Core__Array.resi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core__Array.res b/src/Core__Array.res index 75a2de8a..43d80d2d 100644 --- a/src/Core__Array.res +++ b/src/Core__Array.res @@ -9,7 +9,7 @@ external setUnsafe: (array<'a>, int, 'a) => unit = "%array_unsafe_set" 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 c505adb0..268faca4 100644 --- a/src/Core__Array.resi +++ b/src/Core__Array.resi @@ -4,7 +4,7 @@ @val 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" From bd986507697c34242a718dc29b4115481b51a1f7 Mon Sep 17 00:00:00 2001 From: glennsl Date: Sat, 18 Feb 2023 18:14:54 +0100 Subject: [PATCH 3/3] docs: updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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