1
2
3
4
5
6
7
8
9
10
let giveMeAName source1 source2 =
    Seq.zip source1 source2
    |> Seq.mapi (fun index (elem1, elem2) -> (index, (elem1, elem2))) // could be replaced by (fun index tuple -> (index, tuple))
    |> Seq.filter (fun (_, (elem1, elem2)) -> elem1 <> elem2)
    |> Seq.map (fun (index, (_, elem2)) -> (index, elem2))

let a1 = [| (1, 1); (2, 1); (3, 1); (4, 1) |]
let a2 = [| (1, 1); (2, 3); (3, 1); (4, 2) |]

giveMeAName a1 a2;; //seq [(1, (2, 3)); (3, (4, 2))]
By on 10/26/2011 8:00 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper