Skip to content

Instantly share code, notes, and snippets.

@dgfitch
Created December 1, 2010 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgfitch/723709 to your computer and use it in GitHub Desktop.
Save dgfitch/723709 to your computer and use it in GitHub Desktop.
let parseFacets (input:Dictionary<string,obj>) =
let facets = new Dictionary<string,IDictionary<string,int>>()
let add k v = facets.Add(k, v)
let parse k =
input.[k]
:?> IEnumerable<KeyValuePair<string,obj>>
|> Seq.map (fun kvp -> kvp.Key, kvp.Value :?> int)
|> Map.ofSeq
:> IDictionary<string,int>
|> add k
input.Keys |> Seq.iter parse
facets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment