Tutorial by Examples

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]
b = {:ok, 1, 2} Tuples are the equivalent of arrays in other languages. They are stored contiguously in memory.

Page 1 of 1