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

2021-09-02 Thread José Valim
Hi Tyler! I think starting with a basic List.rotate is very welcome. My questions are: 1. Which of those indexes can be negative? 2. What happens if the middle index is less than or equal to the start index? 3. What happens if the last index is within start and middle? 4. Could List.rotate(list,

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

2021-09-01 Thread Tyler Young
Hi folks! I'd like to propose a List.rotate/4 function (and maybe some convenience wrappers for it as well). Rotate is one of those algorithms that, once I learned about it, I started seeing it everywhere. It's somewhat complicated to grasp (it takes 4 parameters, after all), but in