A RESTful browser for eXist Function Modules


http://exist-db.org/xquery/sequences
Basic XQuery equivalents of map, fold, and filter functions adapted from the standard library of the Scheme programming language. Demonstrates the use of higher-order functions in eXist.

sequences:map($func as function, $seqA as item()*, $seqB as item()*) as item()*
Applies $func to the items of two sequences and returns the results as a new sequence. Both input sequences should have the same length.

sequences:fold($func as function, $seq as item()*, $start as item())
Calls $func for all items in the sequence. For example, if the sequence is (1, 2, 3), $func will be called with arguments (1, 2) and (3, 3).

sequences:filter($func as function, $seq as item()*) as item()*
Filters the passed sequence by calling $func for every item. All items for which $func returns true are copied to the output sequence, items for which it returns false are skipped.
Return to list of all modules