File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ New features:
1111Bugfixes:
1212
1313Other improvements:
14+ - Implements ` ST.push ` via a call to JavaScript's native ` push ` instead of ` pushAll ` (#236 by @i-am-the-slime )
1415
1516## [ v7.2.1] ( https://github.com/purescript/purescript-arrays/releases/tag/v7.2.1 ) - 2023-06-13
1617
Original file line number Diff line number Diff line change @@ -105,3 +105,7 @@ export const toAssocArrayImpl = function (xs) {
105105 for ( var i = 0 ; i < n ; i ++ ) as [ i ] = { value : xs [ i ] , index : i } ;
106106 return as ;
107107} ;
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
181181
182182-- | Append an element to the end of a mutable array. Returns the new length of
183183-- | 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
186188
187189-- | Append the values in an immutable array to the end of a mutable array.
188190-- | Returns the new length of the mutable array.
You can’t perform that action at this time.
0 commit comments