   end
 
   @doc """
-  Iterates the collection passing an accumulator as parameter.
+  Invokes `fun` for each element in the collection passing the accumulator
+  `acc` and the element as arguments. The return value is stored in `acc`.
   Returns the accumulator.
 
   ## Examples

  end

  @doc """
  Invokes the given `fun` for each item in the `collection`
  partitioning it in two lists.

  ## Examples


      #=> 6

  """
  def reduce(collection, acc, fun) when is_list(collection) do
    :lists.foldl(fun, acc, collection)
  end

  def reduce(collection, acc, fun) do
    { iterator, pointer } = I.iterator(collection)
    reduce(iterator, pointer, acc, fun)
  end

  def reduce(iterator, pointer, acc, fun) do
    do_reduce(pointer, iterator, acc, fun)
  end

  @doc """
