Function in collections::vec coil-stdlib

fold_int

fn fold_int(Vec<int> xs, int init, int -> int -> int folder) -> int
Import
use collections::vec::{fold_int};
Source: src/collections/vec.hy

The same as fold; kept for older code.

Parameters#

NameType
xsVec<int>
initint
folderint -> int -> int

Returns#

int

See also#

  • collections::vec::fold
  • contains: Returns true when needle is in xs.
  • index_of: Returns the index of the first needle in xs, or -1.
  • binary_search: Finds needle in the ascending vector xs by halving, and returns an index holding it.
  • dedup: Returns xs with runs of equal neighbours collapsed to one value.
  • map: Returns a new vector with mapper applied to each element, in order.
  • filter: Returns the elements for which pred is true, in order.
  • first: Returns the first element, or None when xs is empty.
↑ ↓ navigate ↵ open