       do_zip mlist, [list_to_tuple(:lists.reverse(heads))|acc]
     end
   end
+
+  defp do_zip_each(_, nil) do
+    { nil, nil }
+  end
+
+  defp do_zip_each([h|t], acc) do
+    { t, [h|acc] }
+  end
+
+  defp do_zip_each([], _) do
+    { nil, nil }
+  end
+
+  defp to_list(tuple) when is_tuple(tuple), do: tuple_to_list(tuple)
+  defp to_list(list)  when is_list(list),   do: list
 end

      #=> [{1, 4}, {2, 5}]

  """
  def zip(list1, list2) when is_list(list1) and is_list(list2) do
    do_zip(list1, list2, [])
  end

  def zip(list, tuple) when is_list(list) and is_tuple(tuple) do
    do_zip(list, tuple_to_list(tuple), [])
  end

  def zip(tuple, list) when is_list(list) and is_tuple(tuple) do
    do_zip(tuple_to_list(tuple), list, [])
  end

  def zip(tuple1, tuple2) when is_tuple(tuple1) and is_tuple(tuple2) do
    do_zip(tuple_to_list(tuple1), tuple_to_list(tuple2), [])
  end

  @doc """

  end

  defp do_zip(list, acc) do
    converter = fn(x, acc) -> do_zip_each(to_list(x), acc) end
    {mlist, heads} = :lists.mapfoldl converter, [], list

    case heads do
    match: nil
