Elixir Language Data Structures Lists


a = [1, 2, 3, true]

Note that these are stored in memory as linked lists. Id est this is a series of cons cells where the head (List.hd/1) is the value of first item of the list and the tail (List.tail/1) is the value of the rest of the list.

List.hd(a) = 1
List.tl(a) = [2, 3, true]