Idiomatic generating function for arrays

I still have to manually manage the indices: an array filled with () does not have information about the indices, it's not like a range.