     do_join(pointer, iterator, joiner, nil)
   end
 
-  # Finds the first item in collection of tuples where the element
-  # `position` in the tuple is equal to `key`. If none is found,
-  # returns `default` (which defaults to nil).
-  #
-  # ## Examples
-  #
-  #     list = [{:a,1},{:b,2},{:a,3}]
-  #     Enum.keyfind list, :a, 1 #=> {:a, 1}
-  #
+  @doc """
+  Finds the first item in collection of tuples where the element
+    `position` in the tuple is equal to `key`. If none is found,
+    returns `default` (which defaults to nil).
+
+    ## Examples
+
+        list = [{:a,1},{:b,2},{:a,3}]
+        Enum.keyfind list, :a, 1 #=> {:a, 1}
+
+  """
   def keyfind(collection, key, position, default) when is_list(collection) do
     :lists.keyfind(key, position, collection) || default
   end

    pointer == __STOP_ITERATOR__
  end

  # Invokes the given `fun` for each item in the `collection`.
  # Returns only the items the function evalutes to true.
  #
  # ## Examples
  #
  #     Enum.filter [1, 2, 3], fn(x, do: rem(x, 2) == 0)
  #     #=> [2]
  #
  def filter(collection, fun) do
    { iterator, pointer } = I.iterator(collection)
    filter(iterator, pointer, fun)

    pointer
  end

  @doc """
  Returns all the entries in the collection. It is the equivalent
  to calling map with an identify function.

  ## Examples

      Enum.entries [1,2,3] #=> [1,2,3]

  """
  def entries(collection) when is_list(collection) do
    collection
  end
