Functions for the List type.
append :: for_type t: (List(t), List(t)) -> List(t) combis :: for_type t: (List(t)) -> List(Tuple(t, t)) cons :: for_type t: (t, List(t)) -> List(t) contains :: for_type t: (List(t), t) -> Boole empty_list :: for_type t: () -> List(t) flat_map :: for_type a, b: ((a) -> List(b), List(a)) -> List(b) flatten :: for_type t: (List(List(t))) -> List(t) fold_list :: for_type t: ((t, t) -> t, List(t)) -> t head :: for_type t: (List(t)) -> t list_size :: for_type t: (List(t)) -> 1 loop_list :: for_type a, t: (a, (a, t) -> a, List(t)) -> a map_list :: for_type s, t: ((s) -> t, List(s)) -> List(t) naturals :: (1) -> List(1) nth :: for_type t: (1, List(t)) -> t remove_nth :: for_type t: (1, List(t)) -> List(t) reverse :: for_type t: (List(t)) -> List(t) scanl :: for_type s, t: ((t, s) -> t, t, List(s)) -> List(t) scanl1 :: for_type t: ((t, t) -> t, List(t)) -> List(t) singleton_list :: for_type t: (t) -> List(t) sort_list :: for_type t: (List(t), (t, t) -> 1) -> List(t) tail :: for_type t: (List(t)) -> List(t) unzip :: for_type s, t: (List(Tuple(s, t))) -> Tuple(List(s), List(t)) zip :: for_type s, t: (List(s), List(t)) -> List(Tuple(s, t)) zip_with :: for_type s, t, u: ((s, t) -> u, List(s), List(t)) -> List(u)
:: for_type t: (List(t), List(t)) -> List(t)
A list that is the concatenation of the two given lists.
Primitive function
:: for_type t: (List(t)) -> List(Tuple(t, t))
A list of pairs containing all combinations of elements from the two given lists.
For example combis([1,2,3]) contains the elements (1,2), (1,3) and
(2,3).
The order is undefined.
:: for_type t: (t, List(t)) -> List(t)
Addes an element to the head of the list.
Primitive function
:: for_type t: (List(t), t) -> Boole
Checks if the element is member of the list.
Primitive function
:: for_type t: () -> List(t)
Constructs an empty list.
Primitive function
:: for_type a, b: ((a) -> List(b), List(a)) -> List(b)
Combines flatten and map.
:: for_type t: (List(List(t))) -> List(t)
Turns a list of lists into a list. All lists are appened.
:: for_type t: ((t, t) -> t, List(t)) -> t
Folds the list with the given function.
Primitive function
:: for_type t: (List(t)) -> t
The head element of the list (the last consed value).
It is an error if the list is empty.
Primitive function
:: for_type t: (List(t)) -> 1
The number of elements in the list.
Primitive function
:: for_type a, t: (a, (a, t) -> a, List(t)) -> a
Calls the given accumulator function for each element of the list and the accumulated value. Starts with the initial value.
Primitive function
:: for_type s, t: ((s) -> t, List(s)) -> List(t)
Applies the given function to each element of a list.
Primitive function
:: (1) -> List(1)
The first x naturals numbers.
Primitive function
:: for_type t: (1, List(t)) -> t
The nth element of the list.
It is an error if the index is out of bounds.
Primitive function
:: for_type t: (1, List(t)) -> List(t)
Copy of the given list with the n-th element removed.
:: for_type t: (List(t)) -> List(t)
The list in reversed order.
Primitive function
:: for_type s, t: ((t, s) -> t, t, List(s)) -> List(t)
:: for_type t: ((t, t) -> t, List(t)) -> List(t)
:: for_type t: (t) -> List(t)
A list containing the given item.
Primitive function
:: for_type t: (List(t), (t, t) -> 1) -> List(t)
Sorts the list with the given order. The order function must return negative, 0 or positive to indicate less, equal or greater.
Primitive function
:: for_type t: (List(t)) -> List(t)
Copy of the list without the head element.
Primitive function
:: for_type s, t: (List(Tuple(s, t))) -> Tuple(List(s), List(t))
Turns a list of pairs into a pair of lists.
:: for_type s, t: (List(s), List(t)) -> List(Tuple(s, t))
Turns a pair of lists into a list of pairs. Each element from the first list is coupled with the corresponding element from the second list.
Primitive function
:: for_type s, t, u: ((s, t) -> u, List(s), List(t)) -> List(u)
Applies the given function to corresponding pairs of elements from the two given lists.
Version v0.6.0, 2026-03-05T15:49:19.127292168+01:00[Europe/Amsterdam]