Your representation is closest to a linked list, not to an array: you have to traverse through each element until you reach the one you want. You are only using index
as a way of addressing the list.
To get a more "faithful" method of addressing, you could replace inner
with isnil
, head
and tail
operations, as per the Church encoding of lists.