@@ -477,8 +477,8 @@ withNewArrayUnsafe count f = do
477477-- /Pre-release/
478478{-# INLINE putIndexUnsafe #-}
479479putIndexUnsafe :: forall m a. (MonadIO m, Unbox a)
480− => Int -> a -> Array a -> m ()
481−putIndexUnsafe i x Array{..} = do
480+ => Int -> Array a -> a -> m ()
481+putIndexUnsafe i Array{..} x = do
482482 let index = INDEX_OF(arrStart, i, a)
483483 assert (i >= 0 && INDEX_VALID(index, arrEnd, a)) (return ())
484484 liftIO $ pokeWith arrContents index x
@@ -490,13 +490,13 @@ invalidIndex label i =
490490-- | /O(1)/ Write the given element at the given index in the array.
491491-- Performs in-place mutation of the array.
492492--
493−-- >>> putIndex arr ix val = Array.modifyIndex ix (const (val, ())) arr
493+-- >>> putIndex ix arr val = Array.modifyIndex ix arr (const (val, ()))
494494-- >>> f = Array.putIndices
495−-- >>> putIndex ix val arr = Stream.fold (f arr) (Stream.fromPure (ix, val))
495+-- >>> putIndex ix arr val = Stream.fold (f arr) (Stream.fromPure (ix, val))
496496--
497497{-# INLINE putIndex #-}
498−putIndex :: forall m a. (MonadIO m, Unbox a) => Int -> a -> Array a -> m ()
499−putIndex i x Array{..} = do
498+putIndex :: forall m a. (MonadIO m, Unbox a) => Int -> Array a -> a -> m ()
499+putIndex i Array{..} x = do
500500 let index = INDEX_OF(arrStart,i,a)
501501 if i >= 0 && INDEX_VALID(index,arrEnd,a)
502502 then liftIO $ pokeWith arrContents index x
@@ -513,14 +513,14 @@ putIndices arr = FL.foldlM' step (return ())
513513
514514 where
515515
516− step () (i, x) = liftIO (putIndex i x arr)
516+ step () (i, x) = liftIO (putIndex i arr x)
517517
518518-- | Modify a given index of an array using a modifier function.
519519--
520520-- /Pre-release/
521521modifyIndexUnsafe :: forall m a b. (MonadIO m, Unbox a) =>
522− Int -> (a -> (a, b)) -> Array a -> m b
523−modifyIndexUnsafe i f Array{..} = liftIO $ do
522+ Int -> Array a -> (a -> (a, b)) -> m b
523+modifyIndexUnsafe i Array{..} f = liftIO $ do
524524 let index = INDEX_OF(arrStart,i,a)
525525 assert (i >= 0 && INDEX_NEXT(index,a) <= arrEnd) (return ())
526526 r <- peekWith arrContents index
@@ -532,8 +532,8 @@ modifyIndexUnsafe i f Array{..} = liftIO $ do
532532--
533533-- /Pre-release/
534534modifyIndex :: forall m a b. (MonadIO m, Unbox a) =>
535− Int -> (a -> (a, b)) -> Array a -> m b
536−modifyIndex i f Array{..} = do
535+ Int -> Array a -> (a -> (a, b)) -> m b
536+modifyIndex i Array{..} f = do
537537 let index = INDEX_OF(arrStart,i,a)
538538 if i >= 0 && INDEX_VALID(index,arrEnd,a)
539539 then liftIO $ do
@@ -549,8 +549,8 @@ modifyIndex i f Array{..} = do
549549-- /Pre-release/
550550{-# INLINE modifyIndices #-}
551551modifyIndices :: forall m a . (MonadIO m, Unbox a)
552− => (Int -> a -> a) -> Array a -> Fold m Int ()
553−modifyIndices f arr = FL.foldlM' step initial
552+ => Array a -> (Int -> a -> a) -> Fold m Int ()
553+modifyIndices arr f = FL.foldlM' step initial
554554
555555 where
556556
@@ -558,14 +558,14 @@ modifyIndices f arr = FL.foldlM' step initial
558558
559559 step () i =
560560 let f1 x = (f i x, ())
561− in modifyIndex i f1 arr
561+ in modifyIndex i arr f1
562562
563563-- | Modify each element of an array using the supplied modifier function.
564564--
565565-- /Pre-release/
566566modify :: forall m a. (MonadIO m, Unbox a)
567− => (a -> a) -> Array a -> m ()
568−modify f Array{..} = liftIO $
567+ => Array a -> (a -> a) -> m ()
568+modify Array{..} f = liftIO $
569569 go arrStart
570570
571571 where
@@ -2341,7 +2341,7 @@ bubble cmp0 arr =
23412341 x1 <- getIndexUnsafe i arr
23422342 case x `cmp0` x1 of
23432343 LT -> do
2344− putIndexUnsafe (i + 1) x1 arr
2344+ putIndexUnsafe (i + 1) arr x1
23452345 go x (i - 1)
2346− _ -> putIndexUnsafe (i + 1) x arr
2347− else putIndexUnsafe (i + 1) x arr
2346+ _ -> putIndexUnsafe (i + 1) arr x
2347+ else putIndexUnsafe (i + 1) arr x