How do I call Enumerable.Join from F#?

I have two sequences (of tuples) on which I need to do a join:

  • Seq 1: [(City1 * Pin1), (City2 * Pin2), (City1 * Pin3), (City1 * Pin4)]
  • Seq 2: [(Pin1 * ProductA), (Pin2 * ProductB), (Pin1 * ProductC), (Pin2 * ProductA)]

into the sequence (of tuples):

  • [(City1 * ProductA), (City2 * ProductB), (City * ProductC), (City2 * Product A)...]

In C# I could do this using the Linq Join extension method like:

seq1.Join(seq2, t => t.Item2, t=> t.Item1,
    (t,u) => Tuple.Create(t.Item1, u.Item2))

How do I accomplish this in F#? I cannot find join on Seq there.

5
задан SharePoint Newbie 23 September 2010 в 11:10
поделиться