Skip to main content
100%

Simple examples of higher-order functions and partial function application in XQuery

✓ Published0🌍 Public
CCliffordAnderson
Last edited Feb 27, 2015
Created on Jun 14, 2014

This example demonstrates higher-order functions and partial application in XQuery 3.0, using code tested with Saxon and Zorba. It shows functions that accept or return other functions, such as `local:pow` returning a function, and the `math:pow#2` built-in being partially applied with `?`. The code also illustrates fold operations (`fold-left`, `fold-right`) and sequence functions (`for-each`, `for-each-pair`, `filter`), applied to string and integer sequences. These snippets highlight how XQuery 3.0 supports functional programming patterns.

AI-generated description

Similar vizzes