F#单位类型

【F#单位类型】单位类型是指示缺少特定值的类型。单元类型只有一个值, 当不存在其他值时, 该值充当占位符。

let function1 x y = x + yfunction1 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

    推荐阅读