我想做一个接受两个值和一个函数的函数。我无法理解语法,所以我做了一个小例子:F#中接受函数的函数
let foo (x : int, y : int, func : int -> int -> int) =
func(x, y)
预期输出:
> foo(2, 3, fun x y -> x + y)
5
但是我得到的编译错误:
The expression was expected to have type int, but here has type 'a * 'b
应该如何这是写?