How do i construct a dictionary from a Seq. I dont seem to be able to get syntax right.
So i have a Seq and i would like to construct a dictionary from it, something like
Document
<Overrides>
<token key="A" value="1"/>
<token key="B" value="2"/>
<token key="C" value="3"/>
<token key="D" value="4"/>
<token key="E" value="5"/>
<token key="F" value="6"/>
let elem = docs |> Seq.map(fun x -> x.Descendants(XName.op_Implicit "Overrides").Elements(XName.op_Implicit "token"))
|> Seq.head
|> Seq.iter(fun (k: XElement , v:XElement) -> k.Attribute(XName.op_Implicit "key").Value, v.Attribute("value").Value)
but get runtime error
Error 1 This expression was expected to have type XElement but here has type 'a * 'b