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
9595foreign import newFloat64Array :: forall a . EffectFn3 a (Nullable ByteOffset ) (Nullable ByteLength ) Float64Array
9696
9797
98- -- ----
99-
100-
10198-- | Value-oriented array offset.
10299type Offset = Int
103100-- | Value-oriented array length.
@@ -209,7 +206,8 @@ foreign import forEachImpl :: forall a b. EffectFn2 (ArrayView a) (EffectFn2 b O
209206all :: forall a t . TypedArray a t => (t -> Boolean ) -> ArrayView a -> Effect Boolean
210207all = every <<< ap1
211208
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.
213211allWithIndex :: forall a t . TypedArray a t => (Offset -> t -> Boolean ) -> ArrayView a -> Effect Boolean
214212allWithIndex = every <<< flip
215213
@@ -233,6 +231,9 @@ foreign import someImpl :: forall a b. EffectFn2 (ArrayView a) (Fn2 b Offset Boo
233231filter :: forall a t . TypedArray a t => (t -> Boolean ) -> ArrayView a -> Effect (ArrayView a )
234232filter = filterWithIndex' <<< ap1
235233
234+ -- | Returns a new typed array with all values that pass the
235+ -- | predicate. The predicate function receives the offset and the
236+ -- | element.
236237filterWithIndex :: forall a t . TypedArray a t => (Offset -> t -> Boolean ) -> ArrayView a -> Effect (ArrayView a )
237238filterWithIndex = filterWithIndex' <<< flip
238239
You can’t perform that action at this time.
0 commit comments