List.wrap

You're seeing just the function wrap, go back to List module for more information.

Specs

wrap(term()) :: maybe_improper_list()

Wraps term in a list if this is not list.

If term is already a list, it returns the list. If term is nil, it returns an empty list.

Examples

iex> List.wrap("hello")
["hello"]

iex> List.wrap([1, 2, 3])
[1, 2, 3]

iex> List.wrap(nil)
[]