I think perhaps you want

1
2
3
4
5
6
7
8
9
open System.Collections.Generic
let dictionary = new Dictionary<string,int>()
dictionary.Add("Apples", 1)
dictionary.Add("Pears", 100)
dictionary
|> Seq.to_array 
//|> Array.sortWith (fun (KeyValue(k1,v1)) (KeyValue(k2,v2))-> compare k1 k2)
|> Array.sortWith (fun (KeyValue(k1,v1)) (KeyValue(k2,v2))-> compare k2 k1)
|> printfn "%A"
By on 7/14/2009 10:48 AM ()

Yes, that is it!

Why is it always that obvious only after someone shows it? :)

Thanks!

By on 7/14/2009 10:52 AM ()
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