group package:vector

O(n) Split a vector into a list of slices of the input vector. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements. Does not fuse. This is the equivalent of 'groupBy (==)'.
>>> import qualified Data.Vector as V

>>> V.group (V.fromList "Mississippi")
["M","i","ss","i","ss","i","pp","i"]
See also 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. This is the equivalent of 'groupBy (==)'.
>>> import qualified Data.Vector.Strict as V

>>> V.group (V.fromList "Mississippi")
["M","i","ss","i","ss","i","pp","i"]
See also group.
O(n) Split a vector into a list of slices of the input vector. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements. Does not fuse. This is the equivalent of 'groupBy (==)'.
>>> import qualified Data.Vector.Primitive as VP

>>> VP.group (VP.fromList "Mississippi")
["M","i","ss","i","ss","i","pp","i"]
See also group.
O(n) Split a vector into a list of slices of the input vector. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements. Does not fuse. This is the equivalent of 'groupBy (==)'.
>>> import qualified Data.Vector.Storable as VS

>>> VS.group (VS.fromList "Mississippi")
["M","i","ss","i","ss","i","pp","i"]
See also group.
O(n) Split a vector into a list of slices of the input vector. The concatenation of this list of slices is equal to the argument vector, and each slice contains only equal elements. Does not fuse. This is the equivalent of 'groupBy (==)'.
>>> import qualified Data.Vector.Unboxed as VU

>>> VU.group (VU.fromList "Mississippi")
["M","i","ss","i","ss","i","pp","i"]
See also 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 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.