@@ -121,7 +121,7 @@ type TestableArrayF a b n t q =
121
121
122
122
overAll' :: forall q n . Testable q => Nat n => Int -> Ref Int -> (forall a b t . TestableArrayF a b n t q ) -> Effect Unit
123
123
overAll' mn count f = do
124
- void (Ref .modify (\x -> x + 1 ) count)
124
+ void (Ref .modify (_ + 1 ) count)
125
125
126
126
let chk :: forall a b t . Show t => Eq t => Ord t => Semiring t => Nat b => BytesPerValue a b => TypedArray a t => String -> Proxy (ArrayView a ) -> Gen t -> Effect Unit
127
127
chk s _ gen = do
@@ -186,7 +186,7 @@ allAreFilledTests count = overAll count allAreFilled
186
186
Nothing -> zero
187
187
Just y -> y
188
188
TA .fill xs x Nothing
189
- let b = TA .all (\y -> y == x) xs
189
+ let b = TA .all (_ == x) xs
190
190
pure (b <?> " All aren't the filled value" )
191
191
192
192
@@ -234,7 +234,7 @@ filterIsTotalTests count = overAll count filterIsTotal
234
234
filterIsTotal (WithOffset _ xs) = do
235
235
let pred x = x /= zero
236
236
ys = TA .filter pred xs
237
- zs = TA .filter (\x -> not pred x ) ys
237
+ zs = TA .filter (not pred) ys
238
238
azs <- TA .toArray zs
239
239
pure $ azs === []
240
240
@@ -333,7 +333,7 @@ foldrConsIsToArrayTests count = overAll count foldrConsIsToArray
333
333
foldrConsIsToArray :: forall a b t . TestableArrayF a b D0 t Result
334
334
foldrConsIsToArray (WithOffset _ xs) = do
335
335
axs <- TA .toArray xs
336
- pure $ TA .foldr (\x acc -> Array .cons x acc) [] xs === axs
336
+ pure $ TA .foldr Array .cons [] xs === axs
337
337
338
338
339
339
foldlSnocIsToArrayTests :: Ref Int -> Effect Unit
@@ -342,7 +342,7 @@ foldlSnocIsToArrayTests count = overAll count foldlSnocIsToArray
342
342
foldlSnocIsToArray :: forall a b t . TestableArrayF a b D0 t Result
343
343
foldlSnocIsToArray (WithOffset _ xs) = do
344
344
axs <- TA .toArray xs
345
- pure $ TA .foldl (\acc x -> Array .snoc acc x) [] xs === axs
345
+ pure $ TA .foldl Array .snoc [] xs === axs
346
346
347
347
348
348
mapIdentityIsIdentityTests :: Ref Int -> Effect Unit
@@ -567,8 +567,7 @@ modifyingOriginalDoesntMutateSlicePartTests count = overAll count modifyingOrigi
567
567
where
568
568
modifyingOriginalDoesntMutateSlicePart :: forall a b t . TestableArrayF a b D1 t Result
569
569
modifyingOriginalDoesntMutateSlicePart (WithOffset os xs) = do
570
- sl <- TA .slice xs (Just (Tuple (Vec .head os) Nothing ))
571
- axs <- TA .toArray sl
570
+ axs <- TA .toArray =<< TA .slice xs (Just (Tuple (Vec .head os) Nothing ))
572
571
let o = Vec .head os
573
572
if Array .all (eq zero) axs || TA .at xs o == Just zero
574
573
then pure Success
@@ -585,8 +584,7 @@ modifyingOriginalDoesntMutateSlicePart2Tests count = overAll count modifyingOrig
585
584
where
586
585
modifyingOriginalDoesntMutateSlicePart2 :: forall a b t . TestableArrayF a b D1 t Result
587
586
modifyingOriginalDoesntMutateSlicePart2 (WithOffset os xs) = do
588
- sl <- TA .slice xs (Just (Tuple (Vec .head os) Nothing ))
589
- axs <- TA .toArray sl
587
+ axs <- TA .toArray =<< TA .slice xs (Just (Tuple (Vec .head os) Nothing ))
590
588
let o = Vec .head os
591
589
if Array .all (eq zero) axs || TA .at xs o == Just zero
592
590
then pure Success
@@ -615,8 +613,7 @@ copyWithinIsSliceTests count = overAll count copyWithinIsSlice
615
613
copyWithinIsSlice :: forall a b t . TestableArrayF a b D1 t Result
616
614
copyWithinIsSlice (WithOffset os xs) = do
617
615
let o = Vec .head os
618
- sl <- TA .slice xs (Just (Tuple o Nothing ))
619
- ys <- TA .toArray sl
616
+ ys <- TA .toArray =<< TA .slice xs (Just (Tuple o Nothing ))
620
617
TA .copyWithin xs 0 o Nothing
621
618
axs <- TA .toArray xs
622
619
zs <- pure $ Array .drop (Array .length ys) axs
0 commit comments