Comparison of single-quoted and double-quotes Strings

Enum.map_join/3:

map_join(enumerable, joiner \\ "", mapper) View Source
map_join(t(), String.t(), (element() -> String.Chars.t())) :: String.t()

i.e. it returns a String.t(), you’re looking for charlist() (or [char()]).

Enum.map/2:

map(enumerable, fun) View Source
map(t(), (element() -> any())) :: list()

returns list() or [any()] or more accurately a list of the type returned by the mapping function, e.g.:

map([char()], (char() -> char())) :: [char()]

something like

map([typeA()], (typeA() -> typeB())) :: [typeB()]

It’s just that Enumerable.t() is anything that has an implementation of the Enumerable protocol (which list() does).

  • charlist() is literally a list of character valued integers
  • String.t() is a binary(), a contiguous chunk of memory where each byte is a UTF-8 codepoint.