我认为有更好的方法来交换列表中的项目([1; 2; 3; 4] - > [2; 1; 4; 3 ]),因为我为我的喜好做了太多附加,但我不确定如何最好地做到这一点。 let swapItems lst =
let f acc item =
match acc with
| [] -> [item]
| hd :: next :: tl when tl
我试图将一个物体投射到一个类似于 这个的通用界面。然而 type IFetchData<'a> =
abstract FetchData: string -> seq<'a>
我的例子使用看起来像FSI如下: let sample = new Sample()
let box_sample = box(sample) //simulate reflection type that