zip combines two lists element by element, producing pairs with type [a] -> [b] -> [(a, b)]. It stops when the shorter list ends. section 4.3.3
This makes zip useful for pairing line numbers with lines and for constructing associative lists without writing specialized recursive code. unzip separates pairs again, but it cannot restore elements discarded from a longer input list. section 4.3.3
Pairing positions with values
zip [1,2,3] ["Hello", "World", "!"] produces [(1,"Hello"),(2,"World"),(3,"!")]. With zip [1..10] [], the result is [], because the empty list determines the stopping point.
When each pair should be transformed immediately, use zipWith, whose type is (a -> b -> c) -> [a] -> [b] -> [c].




