Copyright | (c) Alexey Kuleshevich 2019 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.Massiv.Array.Mutable.Algorithms
Description
Documentation
quicksortM_ :: (Ord e, Mutable r Ix1 e, PrimMonad m) => Scheduler m () -> MArray (PrimState m) r Ix1 e -> m () Source #
Mutable version of quicksort
Since: 0.3.2
Arguments
:: (Mutable r Ix1 e, PrimMonad m) | |
=> MArray (PrimState m) r Ix1 e | |
-> (e -> Bool) | Predicate |
-> m Ix1 |
Partition elements of the supplied mutable vector according to the predicate.
Example
>>>
import Data.Massiv.Array as A
>>>
import Data.Massiv.Array.Mutable.Algorithms
>>>
m <- thaw ([2,1,50,10,20,8] :: Array P Ix1 Int)
>>>
unstablePartitionM m (<= 10)
4>>>
freeze Seq m
Array P Seq (Sz1 6) [ 2, 1, 8, 10, 20, 50 ]
Since: 0.3.2