diff --git a/Data/Vector.hs b/Data/Vector.hs index cca27eaa..883b39cd 100644 --- a/Data/Vector.hs +++ b/Data/Vector.hs @@ -1342,11 +1342,11 @@ unstablePartition :: (a -> Bool) -> Vector a -> (Vector a, Vector a) {-# INLINE unstablePartition #-} unstablePartition = G.unstablePartition --- | /O(n)/ Split the vector in two parts, the first one containing the --- @Left@ elements and the second containing the @Right@ elements. --- The relative order of the elements is preserved. +-- | /O(n)/ Split the vector into two parts, the first one containing the +-- @`Left`@ elements and the second containing the @`Right`@ elements. +-- The relative order of the elements is preserved. -- --- @since 0.12.1.0 +-- @since 0.12.1.0 partitionWith :: (a -> Either b c) -> Vector a -> (Vector b, Vector c) {-# INLINE partitionWith #-} partitionWith = G.partitionWith diff --git a/Data/Vector/Generic.hs b/Data/Vector/Generic.hs index 507bf7d5..ff51f5c5 100644 --- a/Data/Vector/Generic.hs +++ b/Data/Vector/Generic.hs @@ -1436,6 +1436,11 @@ partition_stream f s = s `seq` runST ( v2 <- unsafeFreeze mv2 return (v1,v2)) +-- | /O(n)/ Split the vector into two parts, the first one containing the +-- @`Left`@ elements and the second containing the @`Right`@ elements. +-- The relative order of the elements is preserved. +-- +-- @since 0.12.1.0 partitionWith :: (Vector v a, Vector v b, Vector v c) => (a -> Either b c) -> v a -> (v b, v c) {-# INLINE partitionWith #-} partitionWith f = partition_with_stream f . stream diff --git a/Data/Vector/Primitive.hs b/Data/Vector/Primitive.hs index 7300632d..4d45bf44 100644 --- a/Data/Vector/Primitive.hs +++ b/Data/Vector/Primitive.hs @@ -1085,11 +1085,11 @@ unstablePartition :: Prim a => (a -> Bool) -> Vector a -> (Vector a, Vector a) {-# INLINE unstablePartition #-} unstablePartition = G.unstablePartition --- | /O(n)/ Split the vector in two parts, the first one containing the --- @Right@ elements and the second containing the @Left@ elements. --- The relative order of the elements is preserved. +-- | /O(n)/ Split the vector into two parts, the first one containing the +-- @`Left`@ elements and the second containing the @`Right`@ elements. +-- The relative order of the elements is preserved. -- --- @since 0.12.1.0 +-- @since 0.12.1.0 partitionWith :: (Prim a, Prim b, Prim c) => (a -> Either b c) -> Vector a -> (Vector b, Vector c) {-# INLINE partitionWith #-} partitionWith = G.partitionWith diff --git a/Data/Vector/Storable.hs b/Data/Vector/Storable.hs index bb70174f..1ea40797 100644 --- a/Data/Vector/Storable.hs +++ b/Data/Vector/Storable.hs @@ -1106,11 +1106,11 @@ unstablePartition :: Storable a => (a -> Bool) -> Vector a -> (Vector a, Vector {-# INLINE unstablePartition #-} unstablePartition = G.unstablePartition --- | /O(n)/ Split the vector in two parts, the first one containing the --- @Right@ elements and the second containing the @Left@ elements. --- The relative order of the elements is preserved. +-- | /O(n)/ Split the vector into two parts, the first one containing the +-- @`Left`@ elements and the second containing the @`Right`@ elements. +-- The relative order of the elements is preserved. -- --- @since 0.12.1.0 +-- @since 0.12.1.0 partitionWith :: (Storable a, Storable b, Storable c) => (a -> Either b c) -> Vector a -> (Vector b, Vector c) {-# INLINE partitionWith #-} partitionWith = G.partitionWith diff --git a/Data/Vector/Unboxed.hs b/Data/Vector/Unboxed.hs index 8ed5addb..5ec811d8 100644 --- a/Data/Vector/Unboxed.hs +++ b/Data/Vector/Unboxed.hs @@ -1082,11 +1082,11 @@ unstablePartition :: Unbox a => (a -> Bool) -> Vector a -> (Vector a, Vector a) {-# INLINE unstablePartition #-} unstablePartition = G.unstablePartition --- | /O(n)/ Split the vector in two parts, the first one containing the --- @Right@ elements and the second containing the @Left@ elements. --- The relative order of the elements is preserved. +-- | /O(n)/ Split the vector into two parts, the first one containing the +-- @`Left`@ elements and the second containing the @`Right`@ elements. +-- The relative order of the elements is preserved. -- --- @since 0.12.1.0 +-- @since 0.12.1.0 partitionWith :: (Unbox a, Unbox b, Unbox c) => (a -> Either b c) -> Vector a -> (Vector b, Vector c) {-# INLINE partitionWith #-} partitionWith = G.partitionWith