unzip package:base-compat

Generalization of Data.List.unzip. Since: 4.19.0.0
The unzip function is the inverse of the zip function.
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")
The unzip3 function takes a list of triples and returns three lists, analogous to unzip.
>>> unzip3 []
([],[],[])

>>> unzip3 [(1, 'a', True), (2, 'b', False)]
([1,2],"ab",[True,False])
The mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state monad.