Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created November 20, 2010 19:11
Show Gist options
  • Select an option

  • Save practicingruby/708062 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/708062 to your computer and use it in GitHub Desktop.
def reduce(initial_value, &block)
reduce_fun = fun(element, acc) { block(acc, element) }
erl.lists.foldl(reduce_fun, initial_value, self)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment