@@ -84,10 +84,10 @@ foreign import reduceImpl :: forall a b c. EffectFn3 (ArrayView a) (EffectFn3 c
84
84
foreign import reduce1Impl :: forall a b . EffectFn2 (ArrayView a ) (EffectFn3 b b Offset b ) b
85
85
foreign import reduceRightImpl :: forall a b c . EffectFn3 (ArrayView a ) (EffectFn3 c b Offset c ) c c
86
86
foreign import reduceRight1Impl :: forall a b . EffectFn2 (ArrayView a ) (EffectFn3 b b Offset b ) b
87
- foreign import findImpl :: forall a b . Fn2 (ArrayView a ) (Fn2 b Offset Boolean ) (Nullable b )
88
- foreign import findIndexImpl :: forall a b . Fn2 (ArrayView a ) (Fn2 b Offset Boolean ) (Nullable Offset )
89
- foreign import indexOfImpl :: forall a b . Fn3 (ArrayView a ) b (Nullable Offset ) (Nullable Offset )
90
- foreign import lastIndexOfImpl :: forall a b . Fn3 (ArrayView a ) b (Nullable Offset ) (Nullable Offset )
87
+ foreign import findImpl :: forall a b . EffectFn2 (ArrayView a ) (Fn2 b Offset Boolean ) (Nullable b )
88
+ foreign import findIndexImpl :: forall a b . EffectFn2 (ArrayView a ) (Fn2 b Offset Boolean ) (Nullable Offset )
89
+ foreign import indexOfImpl :: forall a b . EffectFn3 (ArrayView a ) b (Nullable Offset ) (Nullable Offset )
90
+ foreign import lastIndexOfImpl :: forall a b . EffectFn3 (ArrayView a ) b (Nullable Offset ) (Nullable Offset )
91
91
92
92
93
93
-- | Value-oriented array offset
@@ -281,26 +281,26 @@ foldr1M :: forall a t. TypedArray a t => (t -> t -> Offset -> Effect t) -> Array
281
281
foldr1M f a = runEffectFn2 reduceRight1Impl a (mkEffectFn3 (\acc x o -> f x acc o))
282
282
283
283
-- | Returns the first value satisfying the predicate
284
- find :: forall a t . TypedArray a t => (t -> Boolean ) -> ArrayView a -> Maybe t
284
+ find :: forall a t . TypedArray a t => (t -> Boolean ) -> ArrayView a -> Effect ( Maybe t )
285
285
find = findWithIndex' <<< ap1
286
286
287
- findWithIndex :: forall a t . TypedArray a t => (Offset -> t -> Boolean ) -> ArrayView a -> Maybe t
287
+ findWithIndex :: forall a t . TypedArray a t => (Offset -> t -> Boolean ) -> ArrayView a -> Effect ( Maybe t )
288
288
findWithIndex = findWithIndex' <<< flip
289
289
290
- findWithIndex' :: forall a t . TypedArray a t => (t -> Offset -> Boolean ) -> ArrayView a -> Maybe t
291
- findWithIndex' f a = toMaybe (runFn2 findImpl a (mkFn2 f) )
290
+ findWithIndex' :: forall a t . TypedArray a t => (t -> Offset -> Boolean ) -> ArrayView a -> Effect ( Maybe t )
291
+ findWithIndex' f a = toMaybe <$> runEffectFn2 findImpl a (mkFn2 f)
292
292
293
293
-- | Returns the first index of the value satisfying the predicate
294
- findIndex :: forall a t . TypedArray a t => (t -> Offset -> Boolean ) -> ArrayView a -> Maybe Offset
295
- findIndex f a = toMaybe (runFn2 findIndexImpl a (mkFn2 f) )
294
+ findIndex :: forall a t . TypedArray a t => (t -> Offset -> Boolean ) -> ArrayView a -> Effect ( Maybe Offset )
295
+ findIndex f a = toMaybe <$> runEffectFn2 findIndexImpl a (mkFn2 f)
296
296
297
297
-- | Returns the first index of the element, if it exists, from the left
298
- indexOf :: forall a t . TypedArray a t => t -> Maybe Offset -> ArrayView a -> Maybe Offset
299
- indexOf x mo a = toMaybe (runFn3 indexOfImpl a x (toNullable mo) )
298
+ indexOf :: forall a t . TypedArray a t => t -> Maybe Offset -> ArrayView a -> Effect ( Maybe Offset )
299
+ indexOf x mo a = toMaybe <$> runEffectFn3 indexOfImpl a x (toNullable mo)
300
300
301
301
-- | Returns the first index of the element, if it exists, from the right
302
- lastIndexOf :: forall a t . TypedArray a t => t -> Maybe Offset -> ArrayView a -> Maybe Offset
303
- lastIndexOf x mo a = toMaybe (runFn3 lastIndexOfImpl a x (toNullable mo) )
302
+ lastIndexOf :: forall a t . TypedArray a t => t -> Maybe Offset -> ArrayView a -> Effect ( Maybe Offset )
303
+ lastIndexOf x mo a = toMaybe <$> runEffectFn3 lastIndexOfImpl a x (toNullable mo)
304
304
305
305
foldl :: forall a b t . TypedArray a t => (b -> t -> b ) -> b -> ArrayView a -> b
306
306
foldl f = foldlWithIndex' (\a x _ -> f a x)
0 commit comments