File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ New features:
11
11
Bugfixes:
12
12
13
13
Other improvements:
14
+ - Implements ` ST.push ` via a call to JavaScript's native ` push ` instead of ` pushAll ` (#236 by @i-am-the-slime )
14
15
15
16
## [ v7.2.1] ( https://github.com/purescript/purescript-arrays/releases/tag/v7.2.1 ) - 2023-06-13
16
17
Original file line number Diff line number Diff line change @@ -105,3 +105,7 @@ export const toAssocArrayImpl = function (xs) {
105
105
for ( var i = 0 ; i < n ; i ++ ) as [ i ] = { value : xs [ i ] , index : i } ;
106
106
return as ;
107
107
} ;
108
+
109
+ export const pushImpl = function ( a , xs ) {
110
+ return xs . push ( a ) ;
111
+ } ;
Original file line number Diff line number Diff line change @@ -181,8 +181,10 @@ foreign import popImpl
181
181
182
182
-- | Append an element to the end of a mutable array. Returns the new length of
183
183
-- | the array.
184
- push :: forall h a . a -> STArray h a -> ST h Int
185
- push a = runSTFn2 pushAllImpl [ a ]
184
+ push :: forall h a . a -> (STArray h a ) -> ST h Int
185
+ push = runSTFn2 pushImpl
186
+
187
+ foreign import pushImpl :: forall h a . STFn2 a (STArray h a ) h Int
186
188
187
189
-- | Append the values in an immutable array to the end of a mutable array.
188
190
-- | Returns the new length of the mutable array.
You can’t perform that action at this time.
0 commit comments