If your list consists of integers that could all represent printable UTF-8 codepoints in the ASCII set it will be output to the terminal as a charlist.
iex> [104,101,108,108,111]
'hello'
But it is very much still a list:
iex> 'hello' ++ ' there'
'hello there'
If it contains any non-printable code points, it will be output as a standard list:
iex> 'hello' ++ [0]
[104, 101, 108, 108, 111, 0]
You can see what codepoint a character has by using the ?
operator:
iex> ?h
104
We can get info about the term using the i
helper in iex:
iex> i 'hello'
Term
'hello'
Data type
List
Description
This is a list of integers that is printed as a sequence of characters
delimited by single quotes because all the integers in it represent valid
ASCII characters. Conventionally, such lists of integers are referred to
as "charlists" (more precisely, a charlist is a list of Unicode codepoints,
and ASCII is a subset of Unicode).
Raw representation
[104, 101, 108, 108, 111]
Reference modules
List
Why does elixer do this? Erlang.