closest thing to arrays in Elixir

I ended up using a combination of list and registry since I was working with processes. I got many responses on Elixir forum which I'm listing below for future reference:

  1. Tuple: stored continuous in memory, constant access time, editing results in copying whole structure. Does not implement Enumerable protocol.
  2. linked-List: O(n) access time, prefixing is cheaper than suffixing. Implements Enumerable protocol.
  3. Map: O(log n) read, write, delete time. Also implements Enumerable protocol.
  4. :array: array module from Erlang.
  5. registry: (applicable only if storing processes) A local, decentralized and scalable key-value process storage.

Also, note 2 and 3 (List and Map) are persistent data structures.


There are also two Elixir packages Arrays and Tensor that provide similar functionalities.