fold

EveAndersson.com : API Browser : fold

fold

foldf e xs
Defined in tcl/ad-functional.tcl

Takes a binary function f, a start element e and a list {x1 x2 ...} and returns f (...(f (f (f e x1) x2) x3)...).

Examples

  • fold + 0 [list 1 2 3 4] = 10
  • fold * 1 [list 1 2 3 4] = 24

Parameters:
f
e
xs
[ show source ]

Show another procedure:

eve@eveandersson.com