.. default-domain:: chpl .. module:: FunctionalOperations :synopsis: Support for acting on iterators in a functional style. FunctionalOperations ==================== **Usage** .. code-block:: chapel use FunctionalOperations; or .. code-block:: chapel import FunctionalOperations; Support for acting on iterators in a functional style. The `FunctionalOperations` module provides operations that act on iterators in a functional programming style. .. itermethod:: iter _iteratorRecord.map(fn) Apply `fn` to each element yielded by this iterator and yield the value returned by `fn`. `fn` must take a single argument and return a value. .. itermethod:: iter _iteratorRecord.filter(fn) Apply `fn` to each element yielded by this iterator and yield the values it returns `true` for. `fn` must take a single argument and return a boolean value. .. method:: proc _iteratorRecord.consume(fn) Apply `fn` to each element yielded by this iterator and ignore the return value from `fn` if any.