{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
module Data.Massiv.Array.Mutable.Algorithms (
quicksortM_,
quicksortByM_,
unstablePartitionM,
iterateUntilM,
) where
import Data.Massiv.Array.Manifest.Internal (iterateUntilM)
import Data.Massiv.Array.Ops.Sort
import Data.Massiv.Core.Common
unstablePartitionM
:: forall r e m
. (Manifest r e, PrimMonad m)
=> MVector (PrimState m) r e
-> (e -> m Bool)
-> m Ix1
unstablePartitionM :: forall r e (m :: * -> *).
(Manifest r e, PrimMonad m) =>
MVector (PrimState m) r e -> (e -> m Bool) -> m Ix1
unstablePartitionM MVector (PrimState m) r e
marr e -> m Bool
f = forall r e (m :: * -> *).
(Manifest r e, PrimMonad m) =>
MVector (PrimState m) r e -> (e -> m Bool) -> Ix1 -> Ix1 -> m Ix1
unsafeUnstablePartitionRegionM MVector (PrimState m) r e
marr e -> m Bool
f Ix1
0 (forall ix. Sz ix -> ix
unSz (forall r e ix s.
(Manifest r e, Index ix) =>
MArray s r ix e -> Sz ix
sizeOfMArray MVector (PrimState m) r e
marr) forall a. Num a => a -> a -> a
- Ix1
1)