单位类型是指示缺少特定值的类型。单元类型只有一个值, 当不存在其他值时, 该值充当占位符。
let function1 x y = x + y
function1 10 20 // this line results a compiler warning
// changing the code to the following, eliminates the warning
let result = function1 10 20
// Use this if you are calling the function and don't want the return value
function1 10 20 |> ignore
评论前必须登录!
注册