 
   ## Helpers
 
-  @compile {:inline, to_string: 2}
+  @compile {:inline, enum_to_string: 1}
 
   defp enumerate_and_count(collection, count) when is_list(collection) do
     {collection, length(collection) - abs(count)}


  def map_join(collection, joiner, mapper) when is_binary(joiner) do
    reduced = reduce(collection, :first, fn
      entry, :first -> to_string(mapper, entry)
      entry, acc    -> acc <> joiner <> to_string(mapper, entry)
    end)

    if reduced == :first do
      ""
    else
      reduced
    end
  end



  def join(collection, joiner) when is_binary(joiner) do
    reduced = reduce(collection, :first, fn
      entry, :first  -> [enum_to_string(entry)]
      entry, acc -> [enum_to_string(entry), joiner|acc]
    end)
    if reduced == :first do
      ""
    else
      IO.chardata_to_string :lists.reverse(reduced)
    end
  end

