Sha256: f9b1b18ceb816ab6741181d2b37436209d3d045e9c94b9f45513e9040da1c6b8
Contents?: true
Size: 440 Bytes
Versions: 396
Compression:
Stored size: 440 Bytes
Contents
defmodule Accumulate do @doc """ Given a list and a function, apply the function to each list item and replace it with the function's return value. Returns a list. ## Examples iex> Accumulate.accumulate([], fn(x) -> x * 2 end) [] iex> Accumulate.accumulate([1, 2, 3], fn(x) -> x * 2 end) [2, 4, 6] """ @spec accumulate(list, (any -> any)) :: list def accumulate(list, fun) do end end
Version data entries
396 entries across 396 versions & 1 rubygems