Hi,
I have a use case that fits very nicely with the iterator pattern - specifically chaining and cycling iterators. I found https://package.elm-lang.org/packages/fabiommendes/elm-iter/latest/, but couldn’t quite see how to use it. In this package, the iterator state is exposed, which means the type depends on what function is called. This means it’s impossible to declare a struct containing an iterator without knowing if it is the result of Iter.fromList
or Iter.concat
or something else.
I made a library myself where every iterator function simply returns Iter a
. I might publish it if there’s any interest, but I am no Elm expert yet, so can’t make any performance claims. The code certainly looks clean, mostly due to Elm itself
I guess my question is if there exists such a package that I have not found.