Std.List
97 public declarations
- all
&Array[T] -> fn(T) -> Bool -> BoolWhether every element satisfies the predicate. True for an empty array.
- any
&Array[T] -> fn(T) -> Bool -> BoolWhether any element satisfies the predicate. False for an empty array.
- breakWhen
&Array[T] -> fn(T) -> Bool -> (Array[T], Array[T])The longest leading run the predicate *rejects*, and the rest.
- cartesian
&Array[A] -> &Array[B] -> Array[(A, B)]Every pairing of one array's elements with the other's.
- chunksOf
&Array[T] -> Int -> Array[Array[T]]The array in pieces of at most `size` elements.
- concat
&Array[T] -> &Array[T] -> Array[T]One array followed by another.
- contains
&Array[T] -> T -> BoolWhether any element equals the given value.
- count
&Array[T] -> T -> IntHow many elements equal the given value.
- countWhere
&Array[T] -> fn(T) -> Bool -> IntHow many elements the predicate accepts.
- cycle
&Array[T] -> Int -> Array[T]The array repeated end to end a number of times.
- difference
&Array[T] -> &Array[T] -> Array[T]Every element of the first array that is not in the second.
- distinct
&Array[T] -> Array[T]The elements with later duplicates removed, keeping the first of each.
- distinctBy
&Array[T] -> fn(T, T) -> Bool -> Array[T]The elements with later duplicates removed under a comparison.
- drop
&Array[T] -> Int -> Array[T]Every element after the first `skipped`.
- dropEnd
&Array[T] -> Int -> Array[T]Every element but the last `skipped`.
- dropWhile
&Array[T] -> fn(T) -> Bool -> Array[T]Everything after the longest leading run the predicate accepts.
- dropWhileEnd
&Array[T] -> fn(T) -> Bool -> Array[T]The array with trailing elements the predicate accepts removed.
- enumerate
&Array[T] -> Array[(Int, T)]Every element paired with its position.
- filter
&Array[T] -> fn(T) -> Bool -> Array[T]Every element the predicate accepts.
- find
&Array[T] -> fn(T) -> Bool -> Option[T]The first element the predicate accepts, or `None`.
- findIndex
&Array[T] -> fn(T) -> Bool -> Option[Int]The position of the first element the predicate accepts, or `None`.
- findIndices
&Array[T] -> fn(T) -> Bool -> Array[Int]Every position whose element the predicate accepts.
- first
&Array[T] -> Option[T]The first element, or `None` for an empty array.
- flatMap
&Array[A] -> fn(A) -> Array[B] -> Array[B]Every element transformed into an array, and those arrays joined.
- flatten
&Array[Array[T]] -> Array[T]Every array joined end to end.
- fold
&Array[T] -> fn(A, T) -> A -> A -> ACombine every element into one, left to right.
- foldRight
&Array[T] -> fn(T, A) -> A -> A -> ACombine every element into one, right to left.
- get
&Array[T] -> Int -> Option[T]The element at a position, or `None` when there is none.
- group
&Array[T] -> Array[Array[T]]Runs of adjacent equal elements.
- groupBy
&Array[T] -> fn(T, T) -> Bool -> Array[Array[T]]Runs of adjacent elements that a comparison calls equivalent.
- indexOf
&Array[T] -> T -> Option[Int]The position of the first element equal to the given value.
- indicesOf
&Array[T] -> T -> Array[Int]Every position holding the given value.
- initial
&Array[T] -> Array[T]Every element but the last, or an empty array when there is none.
- insertBy
&Array[T] -> T -> fn(T, T) -> Bool -> Array[T]A value placed into an array ordered by a comparison, keeping it in order.
- insertOrdered
&Array[T] -> T -> Array[T] where T: OrdA value placed into an array that is already in ascending order, keeping it
- intercalate
&Array[Array[T]] -> &Array[T] -> Array[T]Every array joined with a separator array between them.
- intersection
&Array[T] -> &Array[T] -> Array[T]Every element of the first array that is also in the second.
- intersperse
&Array[T] -> T -> Array[T]A separator placed between every pair of elements.
- isEmpty
&Array[T] -> BoolWhether the array has no elements.
- isInfixOf
&Array[T] -> &Array[T] -> BoolWhether one array appears inside another as a contiguous run.
- isPrefixOf
&Array[T] -> &Array[T] -> BoolWhether one array begins with another.
- isSuffixOf
&Array[T] -> &Array[T] -> BoolWhether one array ends with another.
- iterate
Int -> T -> fn(T) -> T -> Array[T]Repeated application of a function, starting from a seed.
- last
&Array[T] -> Option[T]The last element, or `None` for an empty array.
- length
&Array[T] -> IntThe number of elements.
- lookup
&Array[(K, V)] -> K -> Option[V]The value paired with the first matching key, or `None`.
- map
&Array[A] -> fn(A) -> B -> Array[B]Every element transformed.
- mapAccum
&Array[T] -> fn(A, T) -> (A, B) -> A -> (A, Array[B])A fold that also collects what each step produced, left to right.
- maximum
&Array[T] -> Option[T] where T: OrdThe largest element, or `None` for an empty array.
- maximumBy
&Array[T] -> fn(T, T) -> Bool -> Option[T]The element a comparison ranks last, or `None` for an empty array.
- maximumOn
&Array[T] -> fn(T) -> K -> Option[T] where K: OrdThe element whose key is largest, or `None` for an empty array.
- merge
&Array[T] -> &Array[T] -> Array[T] where T: OrdTwo ascending arrays interleaved into one.
- mergeBy
&Array[T] -> &Array[T] -> fn(T, T) -> Bool -> Array[T]Two arrays ordered by the same comparison interleaved into one.
- minimum
&Array[T] -> Option[T] where T: OrdThe smallest element, or `None` for an empty array.
- minimumBy
&Array[T] -> fn(T, T) -> Bool -> Option[T]The element a comparison ranks first, or `None` for an empty array.
- minimumOn
&Array[T] -> fn(T) -> K -> Option[T] where K: OrdThe element whose key is smallest, or `None` for an empty array.
- modify
&Array[T] -> Int -> fn(T) -> T -> Array[T]The array with one position transformed, or unchanged when it has none.
- notContains
&Array[T] -> T -> BoolWhether no element equals the given value.
- partition
&Array[T] -> fn(T) -> Bool -> (Array[T], Array[T])The elements the predicate accepts, and the elements it rejects.
- permutations
&Array[T] -> Array[Array[T]]Every ordering of the elements. The count is the factorial of the length,
- pick
&Array[T] -> &Array[Int] -> Array[T]The elements at the given positions, skipping positions the array lacks.
- prefixes
&Array[T] -> Array[Array[T]]Every prefix, shortest first, including the empty one and the whole array.
- product
&Array[T] -> Option[T] where T: One + MulThe product of every element, or `None` for an empty array.
- productOr
&Array[T] -> T -> T where T: One + MulEvery element multiplied together, with a caller-supplied value for empty.
- range
Int -> Int -> Array[Int]The whole numbers from `from` up to but not including `to`.
- removeFirst
&Array[T] -> T -> Array[T]The first occurrence of a value removed, if it is there.
- replicate
Int -> T -> Array[T]A value repeated a number of times. A count below one produces nothing.
- rest
&Array[T] -> Array[T]Every element but the first, or an empty array when there is none.
- reversed
&Array[T] -> Array[T]The elements in reverse order.
- scan
&Array[T] -> fn(A, T) -> A -> A -> Array[A]Every running total, starting from the initial value.
- scanRight
&Array[T] -> fn(T, A) -> A -> A -> Array[A]Every running total, from the right.
- set
&Array[T] -> Int -> T -> Array[T]The array with one position replaced, or unchanged when it has none.
- slice
&Array[T] -> Int -> Int -> Array[T]The elements from `from` up to but not including `to`.
- sortBy
&Array[T] -> fn(T, T) -> Bool -> Array[T]The elements ordered by a comparison the caller supplies.
- sorted
&Array[T] -> Array[T] where T: OrdThe elements in ascending order, under the type's own ordering.
- sortOn
&Array[T] -> fn(T) -> K -> Array[T] where K: OrdThe elements ordered by a key drawn from each one.
- span
&Array[T] -> fn(T) -> Bool -> (Array[T], Array[T])The longest leading run the predicate accepts, and the rest.
- splitAt
&Array[T] -> Int -> (Array[T], Array[T])The array split at a position: the first `at` elements, then the rest.
- stripPrefix
&Array[T] -> &Array[T] -> Option[Array[T]]The remainder after a prefix, or `None` when the prefix is not there.
- stripSuffix
&Array[T] -> &Array[T] -> Option[Array[T]]The remainder before a suffix, or `None` when the suffix is not there.
- subsequences
&Array[T] -> Array[Array[T]]Every subsequence, including the empty one and the whole array.
- suffixes
&Array[T] -> Array[Array[T]]Every suffix, longest first, including the whole array and the empty one.
- sum
&Array[T] -> Option[T] where T: Zero + AddThe sum of every element, or `None` for an empty array.
- sumOr
&Array[T] -> T -> T where T: Zero + AddEvery element added together, with a caller-supplied value for empty.
- take
&Array[T] -> Int -> Array[T]The first `wanted` elements, or every element when the array is shorter.
- takeEnd
&Array[T] -> Int -> Array[T]The last `wanted` elements, or every element when the array is shorter.
- takeWhile
&Array[T] -> fn(T) -> Bool -> Array[T]The longest leading run of elements the predicate accepts.
- transpose
&Array[Array[T]] -> Array[Array[T]]The rows and columns exchanged. Rows of unequal length contribute only the
- unfold
Int -> S -> fn(S) -> Option[(T, S)] -> Array[T]An array grown from a seed until the step answers `None`.
- union
&Array[T] -> &Array[T] -> Array[T]The first array followed by every element of the second it does not contain.
- unzip
&Array[(A, B)] -> (Array[A], Array[B])Pairs separated back into two arrays.
- unzip3
&Array[(A, B, C)] -> (Array[A], Array[B], Array[C])Triples separated back into three arrays.
- windows
&Array[T] -> Int -> Array[Array[T]]Every contiguous run of `size` elements, one position apart.
- zip
&Array[A] -> &Array[B] -> Array[(A, B)]Corresponding elements paired, stopping at the shorter array.
- zip3
&Array[A] -> &Array[B] -> &Array[C] -> Array[(A, B, C)]Three arrays' corresponding elements gathered, stopping at the shortest.
- zipWith
&Array[A] -> &Array[B] -> fn(A, B) -> C -> Array[C]Corresponding elements combined, stopping at the shorter array.
- zipWith3
&Array[A] -> &Array[B] -> &Array[C] -> fn(A, B, C) -> D -> Array[D]Three arrays' corresponding elements combined, stopping at the shortest.
