Combine the corresponding elements of two or more lists
Often we want to combine a number of lists by combining the first
elements of each list with each other, the second elements of each
list with each other, and so on. Haskell provides a family of
functions to do so.
- To combine several lists into a list of tuples, use zip, zip3,
zip4, etc.
- To zip a list of lists together, use transpose.
- To apply a function to the corresponding elements of each
list, use zipWith, zipWith3, zipWith4, etc.
- To decompose a zipped list into its component lists, use unzip,
unzip3, unzip4, etc.