File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,6 @@ foreign import newFloat32Array :: forall a. EffectFn3 a (Nullable ByteOffset) (N
95
95
foreign import newFloat64Array :: forall a . EffectFn3 a (Nullable ByteOffset ) (Nullable ByteLength ) Float64Array
96
96
97
97
98
- -- ----
99
-
100
-
101
98
-- | Value-oriented array offset.
102
99
type Offset = Int
103
100
-- | Value-oriented array length.
@@ -209,7 +206,8 @@ foreign import forEachImpl :: forall a b. EffectFn2 (ArrayView a) (EffectFn2 b O
209
206
all :: forall a t . TypedArray a t => (t -> Boolean ) -> ArrayView a -> Effect Boolean
210
207
all = every <<< ap1
211
208
212
- -- | Test a predicate (that receives also an index) to pass on all values.
209
+ -- | Test a predicate to pass on all values. The predicate function
210
+ -- | receives the offset and the element.
213
211
allWithIndex :: forall a t . TypedArray a t => (Offset -> t -> Boolean ) -> ArrayView a -> Effect Boolean
214
212
allWithIndex = every <<< flip
215
213
@@ -233,6 +231,9 @@ foreign import someImpl :: forall a b. EffectFn2 (ArrayView a) (Fn2 b Offset Boo
233
231
filter :: forall a t . TypedArray a t => (t -> Boolean ) -> ArrayView a -> Effect (ArrayView a )
234
232
filter = filterWithIndex' <<< ap1
235
233
234
+ -- | Returns a new typed array with all values that pass the
235
+ -- | predicate. The predicate function receives the offset and the
236
+ -- | element.
236
237
filterWithIndex :: forall a t . TypedArray a t => (Offset -> t -> Boolean ) -> ArrayView a -> Effect (ArrayView a )
237
238
filterWithIndex = filterWithIndex' <<< flip
238
239
You can’t perform that action at this time.
0 commit comments