   end
 
   def empty?(collection) do
-    { iterator, pointer } = I.iterator(collection)
-    empty?(iterator, pointer)
-  end
-
-  def empty?(_iterator, pointer) do
-    elem(pointer, 1) === :stop
+    { _iterator, pointer, _ } = I.iterator(collection)
+    pointer === :stop
   end
 
   @doc """

  end

  def keyfind(collection, key, position, default) do
    { iterator, pointer } = I.iterator(collection)
    keyfind(iterator, pointer, key, position, default)
  end

  def keyfind(iterator, pointer, key, position, default) do
    do_keyfind(pointer, iterator, key, position, default)
  end


    do_keyfind(iterator.(next), iterator, key, position, ifnone)
  end

  defp do_keyfind(:stop, _, _, _, ifnone) do
    ifnone
  end

  ## map

  defp do_map({ h, next }, iterator, acc, fun, ctor) do
    do_map(iterator.(next), iterator, [fun.(h)|acc], fun, ctor)
  end

  defp do_map(:stop, _, acc, _, ctor) do
    ctor.(List.reverse(acc))
  end

  ## map_reduce

  defp do_map_reduce({ h, next }, iterator, list_acc, acc, f, ctor) do
    { result, acc } = f.(h, acc)
    do_map_reduce(iterator.(next), iterator, [result|list_acc], acc, f, ctor)
  end

  defp do_map_reduce(:stop, _, list_acc, acc, _f, ctor) do
    { ctor.(List.reverse(list_acc)), acc }
  end

  ## partition

  defp do_partition({ h, next }, iterator, fun, acc1, acc2, ctor) do
    case fun.(h) do
    match: x when x == false or x == nil
      do_partition(iterator.(next), iterator, fun, acc1, [h|acc2], ctor)
    else:
      do_partition(iterator.(next), iterator, fun, [h|acc1], acc2, ctor)
    end
  end

  defp do_partition(:stop, _, _, acc1, acc2, ctor) do
    { ctor.(:lists.reverse(acc1)), ctor.(:lists.reverse(acc2)) }
  end

  ## split

  defp do_split({ h, next }, iterator, counter, acc, ctor) when counter > 0 do
    do_split(iterator.(next), iterator, counter - 1, [h|acc], ctor)
  end

  defp do_split({ h, next }, _iterator, 0, acc, ctor) do
    { ctor.(List.reverse(acc)), ctor.([h|next]) }
  end

  defp do_split(:stop, _, _, acc, ctor) do
    { ctor.(List.reverse(acc)), ctor.([]) }
  end

  ## take_while

  defp do_take_while({ h, next }, iterator, fun, acc, ctor) do
    case fun.(h) do
    match: x when x == false or x == nil
      ctor.(List.reverse(acc))
    else:
      do_take_while(iterator.(next), iterator, fun, [h|acc], ctor)
    end
  end

  defp do_take_while(:stop, _, _, acc, ctor) do
    ctor.(List.reverse(acc))
  end

