我需要在 ML 中编写一个函数复合,其行为如下:
Compound 接受 bin op f、int n 和值 x,并将运算符应用于 x N 次。这是一个例子:
compound f 0 x = x
compound f 1 x = x f x
我是 ML 的新手,所以我很难理解如何编写这个函数。我将不胜感激任何帮助!
我需要在 ML 中编写一个函数复合,其行为如下:
Compound 接受 bin op f、int n 和值 x,并将运算符应用于 x N 次。这是一个例子:
compound f 0 x = x
compound f 1 x = x f x
我是 ML 的新手,所以我很难理解如何编写这个函数。我将不胜感激任何帮助!