给定一个列表有点像(简化):
type foo(n:string,m:string,l:string) =
member f.name=n
member f.val1=m
member f.val2=l
let dates = [
foo("a","aa","aaa")
foo("b","bb","bbb")
]
如何制作表单的不可变字典类型结构(例如,Map、IDictionary...任何其他?)key:foo.name,value:foo
?
我最好的猜测是
let fooDict = for f in foo do yield f.name,f
但是这种理解语法只能用于创建列表、数组或序列?