Created a ticket for absent List.walk
variants
The number of combinations looks ridiculous (8 out of 16 are implemented). Does it make sense to combine at least from, until, fromUntil
into a single fromUntil
? It would reduce the number of variants by 8
If to use the same type as in List.range
for the config, it would be possible to eliminate forward/backward
difference, so start
and end
would affect the iteration direction. So it's 2
variants less, leaving only 6
of them:
I already tripped over this while doing AoC. It baffles me that in a functional language these orthogonal concepts, "with index", "backwards", "until" are not easily composable but need dedicated functions for each combination.
walkRange
isn't necessary anymore thanks to seamless slices, and once we have deforestation/fusion we can replace the others with just |> List.reverse
for backwards and |> List.withIndex
for "with index"
you can already do it today using composition, but the performance cost is very high because it requires copying the entire list
so if we didn't expose some of these primitives (range is obsolete and we can get rid of those anytime), then today there would be no option but to pay that performance cost
Last updated: Jul 06 2025 at 12:14 UTC