@@ -84,10 +84,10 @@ foreign import reduceImpl :: forall a b c. EffectFn3 (ArrayView a) (EffectFn3 c
8484foreign import reduce1Impl :: forall a b . EffectFn2 (ArrayView a ) (EffectFn3 b b Offset b ) b
8585foreign import reduceRightImpl :: forall a b c . EffectFn3 (ArrayView a ) (EffectFn3 c b Offset c ) c c
8686foreign 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 )
9191
9292
9393-- | Value-oriented array offset
@@ -281,26 +281,26 @@ foldr1M :: forall a t. TypedArray a t => (t -> t -> Offset -> Effect t) -> Array
281281foldr1M f a = runEffectFn2 reduceRight1Impl a (mkEffectFn3 (\acc x o -> f x acc o))
282282
283283-- | 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 )
285285find = findWithIndex' <<< ap1
286286
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 )
288288findWithIndex = findWithIndex' <<< flip
289289
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)
292292
293293-- | 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)
296296
297297-- | 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)
300300
301301-- | 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)
304304
305305foldl :: forall a b t . TypedArray a t => (b -> t -> b ) -> b -> ArrayView a -> b
306306foldl f = foldlWithIndex' (\a x _ -> f a x)
0 commit comments