Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Data/Vector.hs
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
5 changes: 5 additions & 0 deletions Data/Vector/Generic.hs
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
8 changes: 4 additions & 4 deletions Data/Vector/Primitive.hs
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
8 changes: 4 additions & 4 deletions Data/Vector/Storable.hs
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down
8 changes: 4 additions & 4 deletions Data/Vector/Unboxed.hs
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand Down