Skip to content

Commit 7e5febc

Browse files
committed
Docs
1 parent f68f7cd commit 7e5febc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Data/ArrayBuffer/Typed.purs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ foreign import newFloat32Array :: forall a. EffectFn3 a (Nullable ByteOffset) (N
9595
foreign import newFloat64Array :: forall a. EffectFn3 a (Nullable ByteOffset) (Nullable ByteLength) Float64Array
9696

9797

98-
-- ----
99-
100-
10198
-- | Value-oriented array offset.
10299
type Offset = Int
103100
-- | Value-oriented array length.
@@ -209,7 +206,8 @@ foreign import forEachImpl :: forall a b. EffectFn2 (ArrayView a) (EffectFn2 b O
209206
all :: forall a t. TypedArray a t => (t -> Boolean) -> ArrayView a -> Effect Boolean
210207
all = 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.
213211
allWithIndex :: forall a t. TypedArray a t => (Offset -> t -> Boolean) -> ArrayView a -> Effect Boolean
214212
allWithIndex = every <<< flip
215213

@@ -233,6 +231,9 @@ foreign import someImpl :: forall a b. EffectFn2 (ArrayView a) (Fn2 b Offset Boo
233231
filter :: forall a t. TypedArray a t => (t -> Boolean) -> ArrayView a -> Effect (ArrayView a)
234232
filter = 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.
236237
filterWithIndex :: forall a t. TypedArray a t => (Offset -> t -> Boolean) -> ArrayView a -> Effect (ArrayView a)
237238
filterWithIndex = filterWithIndex' <<< flip
238239

0 commit comments

Comments
 (0)