I was hoping this would be ok. It wasn’t. FR: Have Durations support ranges so I can do this expression.
for(i in Duration.ZERO..maxDuration step offset) { ... }
I think getting it to work would involve something like https://www.netguru.com/codestories/traversing-through-dates-with-kotlin-range-expressions
Yes or something like that: Custom Range Iterator
And then add an infix function.
In this generic kotlinx.interval library, I add support for “intervals” (functionally speaking a superset of ranges) of datetime/durations.
I haven’t implemented progressions yet, though, but this is where I see this library evolve over time; that is the exact same use case I had before when I wrote a similar C# library. I don’t expect basic language support for ranges to easily expand to incorporate such “advanced” interval use cases any time soon.