Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

List functions

Build, take apart and transform lists: map, fold, join, partition, count and search their elements.

52 functions

Described functions

  • length

    Number of elements in a list.

  • map

    Apply a function to every element of a list.

  • range

    The whole numbers in a range, as a list.

  • table

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

  • accumulate

    Running totals of a list.

  • append

    A list with an element added at the end.

  • apply

    Replace the head of an expression, or the brackets of a list, with a function.

  • complement

    The elements of a list that are in none of the others.

  • constant_array

    A list of copies of a value.

  • count

    How many elements of a list equal a value.

  • dimensions

    The size of a list or a matrix, level by level.

  • drop

    A list without its first elements.

  • first

    The first element of a list.

  • flatten

    Nested lists flattened into one list.

  • fold

    Combine the elements of a list from the left with a function, starting from a value.

  • fold_list

    The steps of fold: every partial result, starting from the first value.

  • head

    The head of an expression: the name of the function it is a call of.

  • intersection

    The elements that are in every one of some lists.

  • join

    Join lists into one.

  • last

    The last element of a list.

  • list

    A list of the arguments.

  • map_thread

    Apply a function to corresponding elements of several lists.

  • most

    A list without its last element.

  • nest

    Apply a function again and again to a value.

  • nest_list

    The steps of nest: the value after each application, starting from the first.

  • part

    Read part of a list by position, counting from 1; also written list[i].

  • partition

    A list split into blocks of a given length.

  • position

    Where a value occurs in a list, as a list of positions.

  • prepend

    A list with an element added at the start.

  • replace_part

    A list with the part at a position replaced; write position -> value.

  • rest

    A list without its first element.

  • reverse

    A list in reverse order.

  • riffle

    A list with a value put between its elements.

  • rotate_left

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

  • rotate_right

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

  • select

    The elements of a list for which a test holds.

  • sort

    A list in increasing order.

  • subsets

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

  • take

    The first elements of a list.

  • tally

    How often each element occurs: a list of element and count pairs.

  • thread

    Apply a function to corresponding elements of lists.

  • total

    Sum of the elements of a list.

  • union

    The elements in any of some lists, each once, in order.

More functions in this category

Nobody has described these yet: each is listed with its first form.

Other categories

Last updated