23
23
-- | - `foldr`, `foldrM`, `foldr1`, `foldr1M`, `foldl`, `foldlM`, `foldl1`, `foldl1M` all can reduce an array
24
24
-- | - `find` and `findIndex` are searching functions via a predicate
25
25
-- | - `indexOf` and `lastIndexOf` are searching functions via equality
26
- -- | - `slice` returns a new typed array on the same array buffer content as the input
27
- -- | - `subArray` returns a new typed array with a separate array buffer
26
+ -- | - `slice` returns a new typed array with a new copied underlying `ArrayBuffer`
27
+ -- | - `subArray` returns a new typed array view of the same `ArrayBuffer`
28
28
-- | - `toString` prints to a CSV, `join` allows you to supply the delimiter
29
29
-- | - `toArray` returns an array of numeric values
30
30
@@ -211,7 +211,7 @@ set = setInternal A.length
211
211
ap1 :: forall a b c . (a -> c ) -> (a -> b -> c )
212
212
ap1 f = \x _ -> f x
213
213
214
- -- | Maps a new value over the typed array, creating a new buffer and
214
+ -- | Maps a new value over the typed array, creating a new `ArrayBuffer` and
215
215
-- | typed array as well.
216
216
map :: forall a t . TypedArray a t => (t -> t ) -> ArrayView a -> ArrayView a
217
217
map = mapWithIndex' <<< ap1
@@ -415,7 +415,8 @@ foreign import setImpl :: forall a b. EffectFn3 (ArrayView a) Index b Unit
415
415
setTyped :: forall a . ArrayView a -> Maybe Index -> ArrayView a -> Effect Boolean
416
416
setTyped = setInternal length
417
417
418
- -- | Copy part of the contents of a typed array into a new buffer, between some start and end indices.
418
+ -- | Copy part of the contents of a typed array into a new `ArrayBuffer`,
419
+ -- | between the start and end indices.
419
420
slice :: forall a . Index -> Index -> ArrayView a -> Effect (ArrayView a )
420
421
slice s e a = runEffectFn3 sliceImpl a s e
421
422
@@ -427,7 +428,8 @@ sort a = runEffectFn1 sortImpl a
427
428
428
429
foreign import sortImpl :: forall a . EffectFn1 (ArrayView a ) Unit
429
430
430
- -- | Returns a new typed array view of the same buffer, beginning at the index and ending at the second.
431
+ -- | Returns a new typed array view of the same `ArrayBuffer`, beginning at
432
+ -- | the index and ending at the second.
431
433
subArray :: forall a . Index -> Index -> ArrayView a -> ArrayView a
432
434
subArray s e a = runFn3 subArrayImpl a s e
433
435
0 commit comments