Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

List.zip3<'T1,'T2,'T3> Function (F#)

Combines the three lists into a list of triples. The lists must have equal lengths.

Namespace/Module Path: Microsoft.FSharp.Collections.List

Assembly: FSharp.Core (in FSharp.Core.dll)

// Signature:
List.zip3 : 'T1 list -> 'T2 list -> 'T3 list -> ('T1 * 'T2 * 'T3) list

// Usage:
List.zip3 list1 list2 list3

Type: 'T1 list

The first input list.


Type: 'T2 list

The second input list.


Type: 'T3 list

The third input list.

A single list containing triples of matching elements from the input lists.

This function is named Zip3 in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.

The following code example illustrates the use of List.zip3.

let list1 = [ 1; 2; 3 ]
let list2 = [ -1; -2; -3 ]
let list3 = [ 0; 0; 0]
let listZip3 = List.zip3 list1 list2 list3
printfn "%A" listZip3


[(1, -1, 0); (2, -2, 0); (3, -3, 0)]

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

F# Runtime

Supported in: 2.0, 4.0


Supported in: 3

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.