Add new element to list

Just follow the Elixir docs to add an element to a list ( and keep performance in mind =) ): iex> list = [1, 2, 3] iex> [0 | list] # fast [0, 1, 2, 3] iex> list ++ [4] # slow [1, 2, 3, 4] https://hexdocs.pm/elixir/List.html

How do I recompile an Elixir project and reload it from within iex?

You can use the IEx.Helpers.recompile/0 function. Recompiles the current Mix application. This helper only works when IEx is started with a Mix project, for example, iex -S mix. Before compiling the code, it will stop the current application, and start it again afterwards. Stopping applications are required so processes in the supervision tree won’t crash …

Read more