Higher order Functions

function-lookup( xs:QName("fn:substring"),2)("abcd",2)
returns bcd.
function-name(fn:substring#2)
returns fn:substring
function-arity(fn:substring#3)
returns 3
for-each(1 to 5, function($a) { $a * $a })
returns (1,4,9,16,25)
filter(1 to 10, function($a) {$a mod 2 = 0})
returns (2,4,6,8,10)
fold-left(1 to 5, 10000, function($a, $b) { $a + $b })
returns 10015
fold-right(1 to 5, "***", fn:concat(?, ".", ?))
returns 1.2.3.4.5.***
for-each-pair(("a", "b", "c"), ("x", "y", "z"),  concat#2)
returns (“ax”,”by”,”cz”)