partitionM (Just . even) [1,2,3] == Just ([2], [1,3]) partitionM (const Nothing) [1,2,3] == Nothing
forAllMaybeFn $ \f xs -> partitionMaybe f xs == (mapMaybe f xs, filter (isNothing . f) xs)
forAllPredicates $ \p xs -> partition p xs == partitionMaybe (\x -> toMaybe (p x) x) xs
>>> 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 ]