我正在学习 Kotlin,想知道是否有人可以就以下 F# 片段在惯用的 Kotlin 中的外观提出建议。
// a function that has an Option<int> as input
let printOption x = match x with
| Some i -> printfn "The int is %i" i
| None -> printfn "No value"
太感谢了。(顺便说一句,该片段来自 Scott Wlaschin 精彩的Domain Modeling Made Functional)