如何抽象化Int32和Int64类型的方法?
具体来说,如何将这些相似的函数重构为核心函数?
let private tryParseInt64 (text:string) =
let mutable (number:Int64) = 0L
if Int64.TryParse(text, ref number)
then Some number
else None
let private tryParseInt32 (text:string) =
let mutable (number:Int32) = 0
if Int32.TryParse(text, ref number)
then Some number
else None