unzip -package:streaming

unzip transforms a list of pairs into a list of first components and a list of second components.

Examples

>>> unzip []
([],[])
>>> unzip [(1, 'a'), (2, 'b')]
([1,2],"ab")
Generalization of Data.List.unzip.

Examples

>>> unzip (Just ("Hello", "World"))
(Just "Hello",Just "World")
>>> unzip [("I", "love"), ("really", "haskell")]
(["I","really"],["love","haskell"])
Warning: This function will be made monomorphic in base-4.22, consider switching to Data.Functor.unzip
O(n) unzip transforms a list of pairs of bytes into a pair of ByteStrings. Note that this performs two pack operations.
unzip transforms a list of pairs of Chars into a pair of ByteStrings. Note that this performs two pack operations.
O(n) unzip transforms a list of pairs of chars into a pair of ByteStrings. Note that this performs two pack operations.
Unzip a sequence of pairs.
unzip ps = ps `seq` (fmap fst ps) (fmap snd ps)
Example:
unzip $ fromList [(1,"a"), (2,"b"), (3,"c")] =
(fromList [1,2,3], fromList ["a", "b", "c"])
See the note about efficiency at unzipWith.
O(min(m,n)) Unzip a vector of pairs.
O(min(m,n)) Unzip a vector of pairs.
O(1) Unzip 2 vectors.
O(1) Unzip 2 vectors.
unzip transforms a list of pairs into a list of first components and a list of second components.
>>> unzip []
([],[])

>>> unzip [(1, 'a'), (2, 'b')]
([1,2],"ab")
Generalization of Data.List.unzip. Since: 4.19.0.0
The unzip function is the inverse of the zip function.
Caution: Every pair member has a reference to the argument of unzip. Depending on the consumption pattern this may cause a memory leak. For lists, I think, you should generally prefer unzip.
Like standard unzip but more lazy. It is Data.List.unzip undefined == undefined, but unzip undefined == (undefined, undefined).
Unzip for stict pairs into a (lazy) pair of lists.
Takes apart a stream of pairs, producing a pair of input streams. Reading from either of the produced streams will cause a pair of values to be pulled from the original stream if necessary. Note that reading n values from one of the returned streams will cause n values to be buffered at the other stream. Access to the original stream is thread safe, i.e. guarded by a lock.
unzip transforms a list of pairs into a list of first components and a list of second components.
O(1) Unzip 2 vectors
O(1). Unzip an unboxed array.
Converts a list of pairs into two separate lists of elements