On Saturday, September 4, 2021 at 7:21:45 PM UTC+2 José Valim wrote:
> 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. > The main part of the algorithm could be written using a couple of calls to `Enum(erable).slice`. In this case, at least as long as the number of elements to be moved is small, the implementation is faster than linear (for types that support faster than linear slicing). That is, until we concatenate the results at the end to form the rotated list. So at most it is an efficiency improvement of a constant factor, but the result will still be linear. Hmm... -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/d54e1e48-a32c-4d9c-8307-d5cb7926050cn%40googlegroups.com.