#Why list.range e int.range is so different ?
1 messages · Page 1 of 1 (latest)
Looking at the implementation what I understood is that receiving an accumulator, it becomes agnostic to what kind of "list" it generates as long as it receives a function that aggregates to this accumulator, thinking better this is a very cool idea on how to generate a list, very cool!
Yeah it got replaced because list.range wasn't all that useful and usually folks piped it immediately into list.map or list.fold
it's the same as list.range(from, to) |> list.fold(acc, reducer) but skips the intermediate list
oooh
so in practice it's usually simpler to use that new function and it's faster!
i understands now
(just not in the case where you.. actually need a list of integers) 😄
This implementation isn't that complicated to use; if you need more instructions, I think it would become rather tedious to write. For simple situations, but in my case, I'm basically studying sets and practicing a bit, so this implementation will be very useful when I need to express more complex constraint notations.
We changed it because we did research on how it was used and found it was never actually used to create a list of ints. It was always used to do some looping, which it wasn’t a good design for