ZVON > References > Haskell reference
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Prelude
Function: zip
Type: [a] -> [b] -> [(a,b)]
Description: makes a list of tuples, each tuple conteining elements of both lists occuring at the same position
Related: unzip, unzip3, zip3, zipWith, zipWith3

Example 1

Input: zip [1,2,3] [9,8,7]

Output: [(1,9),(2,8),(3,7)]

Example 2

Input: zip [1,2,3,4,5] [9,8]

Output: [(1,9),(2,8)]

Example 3

Input: zip (take 5 (iterate (2*) 10)) (take 5 (iterate (2/) 10))

Output: [(10,10.0),(20,0.2),(40,10.0),(80,0.2),(160,10.0)]