您知道要解开单个联合类型的值,您必须这样做:
type Foo = Foo of int*string
let processFoo foo =
let (Foo (t1,t2)) = foo
printfn "%A %A" t1 t2
但我的问题是:如果有办法为列表做到这一点?:
let processFooList (foolist:Foo list ) =
let ??? = foolist // how to get a int*string list
...
谢谢。