1
如何在盒裝元組上匹配模式?還是有更好的辦法做這樣的事情(例如簡化):F# - 在盒裝元組上匹配模式
open System.Drawing
let coerceColor a =
match box a with
| :? Color as c -> c
| (:? int as r),(:? int as g),(:? int as b) -> Color.FromArgb(r,g,b)
| _ -> failwith "Cannot coerce color"
感謝古斯塔沃,我認爲它一定很好,很簡單。 – Goswin