Table of contents
TOC
Collapse the table of content
Expand the table of content

Function.From

Owen Duncan|Last Updated: 4/19/2018
|
1 Contributor

Function.From(functionType as type, function as function) as function

About

Takes a unary function function and creates a new function with the type functionType that constructs a list out of its arguments and passes it to function.

Example 1

Converts List.Sum into a two-argument function whose arguments are added together.

Function.From(type function (a as number, b as number) as number, List.Sum)(2, 1)

3

Example 2

Converts a function taking a list into a two-argument function.

Function.From(type function (a as text, b as text) as text, (list) => list{0} & list{1})("2", "1")

"21"

© 2018 Microsoft