I try to do the Advent of Code challenges in different languages.
Already with Day 1 part 2 I have some problems with ReasonML.
The challenge asks to repeat multiple times over a list of numbers until a specific result is found.
I looked at the solutions of different languages and I saw some functions to make the iteration over the list possible.
In Clojure there is a cycle function.
In Elixir there is also a Stream.cycle function.
In F# I could implement my own cycle function with the help of lazy sequences.
Is there a similar function available in ReasonML?
I now that an implementation of this function is probably only possible with some kind of a “lazy” list.
There is another question that I have:
I know about the existence of the Belt library. But I did not find in it if there is an implementation of a lazy list and/or sequence type in there…