partitionM package:massiv

Partition elements of the supplied mutable vector according to the predicate.

Example

>>> import Data.Massiv.Array as A

>>> import Data.Massiv.Array.Mutable.Algorithms

>>> :set -XOverloadedLists

>>> m <- thaw ([2,1,50,10,20,8] :: Array P Ix1 Int)

>>> unstablePartitionM m (pure . (<= 10))
4

>>> freeze Seq m
Array P Seq (Sz1 6)
[ 2, 1, 8, 10, 20, 50 ]