groupBy package:vector

O(n) Split a vector into a list of slices, using a predicate function. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements, as determined by the equality predicate function. Does not fuse.
>>> import qualified Data.Vector as V

>>> import           Data.Char (isUpper)

>>> V.groupBy (\a b -> isUpper a == isUpper b) (V.fromList "Mississippi River")
["M","ississippi ","R","iver"]
See also groupBy, group.
O(n) Split a vector into a list of slices. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements, as determined by the equality predicate function.
>>> import qualified Data.Vector.Strict as V

>>> import           Data.Char (isUpper)

>>> V.groupBy (\a b -> isUpper a == isUpper b) (V.fromList "Mississippi River")
["M","ississippi ","R","iver"]
See also groupBy.
O(n) Split a vector into a list of slices, using a predicate function. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements, as determined by the equality predicate function. Does not fuse.
>>> import qualified Data.Vector.Primitive as VP

>>> import           Data.Char (isUpper)

>>> VP.groupBy (\a b -> isUpper a == isUpper b) (VP.fromList "Mississippi River")
["M","ississippi ","R","iver"]
See also groupBy, group.
O(n) Split a vector into a list of slices, using a predicate function. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements, as determined by the equality predicate function. Does not fuse.
>>> import qualified Data.Vector.Storable as VS

>>> import           Data.Char (isUpper)

>>> VS.groupBy (\a b -> isUpper a == isUpper b) (VS.fromList "Mississippi River")
["M","ississippi ","R","iver"]
See also groupBy, group.
O(n) Split a vector into a list of slices, using a predicate function. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements, as determined by the equality predicate function. Does not fuse.
>>> import qualified Data.Vector.Unboxed as VU

>>> import           Data.Char (isUpper)

>>> VU.groupBy (\a b -> isUpper a == isUpper b) (VU.fromList "Mississippi River")
["M","ississippi ","R","iver"]
See also groupBy, group.