Function.From
Function.From(functionType as type, function as function) as function
采用一元函数 function
并创建一个类型为 functionType
的新函数,用于构造其参数列表,并将其传递给 function
。
将 List.Sum 转换为一个包含两个参数的函数,其参数捆绑添加。
使用情况
Function.From(type function (a as number, b as number) as number, List.Sum)(2, 1)
输出
3
将接受列表的函数转换为双参数函数。
使用情况
Function.From(type function (a as text, b as text) as text, (list) => list{0} & list{1})("2", "1")
输出
"21"