Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

select function

The elements of a list for which a test holds.

How to write it

select(list, test)

list
The list. Takes a list.
test
A function that is true or false for an element. Takes a function.

Examples

  • select⁡([1,2,3,4],x↦x>2)=[3,4]\displaystyle \operatorname{select}(\left[ 1, 2, 3, 4 \right], x \mapsto x > 2) = \left[ 3, 4 \right]
    select([1, 2, 3, 4], x => x > 2)

    In the solver, select([1, 2, 3, 4], x => x > 2) gives [3, 4].

    Open in the solver
  • sort

    A list in increasing order.

  • rotate_right

    A list with its elements moved to the right, the last ones going to the front.

  • subsets

    All the sublists of a list that keep its order, as a list.

  • rotate_left

    A list with its elements moved to the left, the first ones going to the end.

  • table

    Build a list by evaluating an expression over one or more ranges.

  • riffle

    A list with a value put between its elements.