A recursive data structure contains parts with the same form. In Elixir, a nonempty list is a pair: [head | tail], where tail is another list. section 2.4.4
The list representation makes several operational properties visible:
- Reading the head or tail takes O(1), because each operation reads one part of the pair. section 2.4.4
- Prepending is efficient; appending or concatenating traverses the left list and costs O(n). section 2.4.4
- Pattern matching can bind the two parts directly with [head | tail]. section 3.1.5
Building a list from pairs
[1 | [2 | [3 | [4 | []]]]] produces [1, 2, 3, 4]. A practical match, [head | tail] = [1, 2, 3], binds head to 1 and tail to [2, 3]. section 2.4.4 section 3.1.5
Use the list diagram to visualize how each tail points to the next head-tail pair. section 2.4.4

