例如,我可以这样做:
let mutable divide = fun (a,b) -> a / b
let checkZero (a,b) = if b = 0 then failwith "wrong" else (a,b)
divide <- checkZero >> divide
divide (5,3)
但是如果我想形成一个柯里化函数怎么办:
let mutable divide = fun a b -> a / b
let checkZero a b = if b = 0 then failwith "wrong" else ... // How return
// the two argument
divide <- checkZero >> divide
divide 5 3
我可以这样做吗?