-- at xs i: i-th element of a list (0-indexed).
-- Negative i counts from the end: -1 is the last element.
-- Out-of-range (i >= len or i < -len) is a runtime error.
nth xs:L n i:n>n;at xs i
last xs:L n>n;at xs -1
penultimate xs:L n>n;at xs -2
-- run: nth [10,20,30] 1
-- out: 20
-- run: nth [10,20,30] 0
-- out: 10
-- run: nth [10,20,30] 2
-- out: 30
-- run: last [10,20,30]
-- out: 30
-- run: penultimate [10,20,30]
-- out: 20