Skip to content

Commit b1cc1af

Browse files
authored
Fix incorrect type signatures in Array (#50)
* fix(array): wrong type signature for fromArrayLikeWithMap * fix(array): wrong type signature for fromIteratorWithMap * docs: updated changelog
1 parent 71c1124 commit b1cc1af

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Change `Iterator` bindings to have the same shape as `AsyncIterator` for consistency. https://github.com/rescript-association/rescript-core/pull/34
1010
- Add `Iterator.toArray` binding for turning an iterator into an array. https://github.com/rescript-association/rescript-core/pull/34
1111
- Add `Array.at` binding for returning an array item by its index. https://github.com/rescript-association/rescript-core/pull/48
12+
- Fixed type signatures of `Array.fromArrayLikeWithMap` and `Array.fromIteratorWithMap`. https://github.com/rescript-association/rescript-core/pull/50
1213

1314
### Documentation
1415

src/Core__Array.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ external setUnsafe: (array<'a>, int, 'a) => unit = "%array_unsafe_set"
66

77
@val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from"
88
@val
9-
external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'a> = "Array.from"
9+
external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b> = "Array.from"
1010

1111
@val external fromIterator: Core__Iterator.t<'a> => array<'a> = "Array.from"
12-
@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'c) => array<'a> = "Array.from"
12+
@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'b) => array<'b> = "Array.from"
1313

1414
@val external isArray: 'a => bool = "Array.isArray"
1515

src/Core__Array.resi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
@val external fromWithMap: ('a, 'b => 'c) => array<'c> = "Array.from"
33
@val external fromArrayLike: Js.Array2.array_like<'a> => array<'a> = "Array.from"
44
@val
5-
external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'a> = "Array.from"
5+
external fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b> = "Array.from"
66
@val external fromIterator: Core__Iterator.t<'a> => array<'a> = "Array.from"
7-
@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'c) => array<'a> = "Array.from"
7+
@val external fromIteratorWithMap: (Core__Iterator.t<'a>, 'a => 'b) => array<'b> = "Array.from"
88
@val external isArray: 'a => bool = "Array.isArray"
99
@get external length: array<'a> => int = "length"
1010
@send external copyAllWithin: (array<'a>, ~target: int) => array<'a> = "copyWithin"

0 commit comments

Comments
 (0)