Hi, I've made some working code in gleam but list.at is deprecated for:
Gleam lists are immutable linked lists, so indexing into them is a slow
operation that must traverse the list.In functional programming it is very rare to use indexing, so if you are
using indexing then a different algorithm or a different data structure is
likely more appropriate.
So I'm curious what alternative approaches to this could look like? Here's the code: https://gist.github.com/u9g/3a2bef2dbccdd3ca67219de97f040008
One approach I thought of is that I could hold the iterator in the state and just cycle it, and on ShouldUpdate I just step it, but I'm curious if there are any other possibilities here?