Re: [elixir-core:10433] [Proposal] List.rotate/4

2021-09-04 Thread José Valim
It could definitely be implemented as a Enum or a Stream function, but the level of complexity is definitely much higher, and reduce would force the implementation to be linear anyway. So I am honestly not sure if it is worth it. On Sat, Sep 4, 2021 at 7:07 PM w...@resilia.nl wrote: > >

Re: [elixir-core:10433] [Proposal] List.rotate/4

2021-09-04 Thread w...@resilia.nl
> Wiebe-Marten Wijnja, unfortunately I think those operations would be relatively expensive on an array too, in terms of mutations, although the index lookup is faster. As other function in the List module, I think we should document that they would be very expensive in a loop (but ok as