unzip package:base-prelude

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 unzip4 function takes a list of quadruples and returns four lists, analogous to unzip.
The unzip5 function takes a list of five-tuples and returns five lists, analogous to unzip.
The unzip6 function takes a list of six-tuples and returns six lists, analogous to unzip.
The unzip7 function takes a list of seven-tuples and returns seven lists, analogous to unzip.
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.