Proposal: add a list.rotate/2
function
#3959
rbobillot
started this conversation in
Ideas & suggestions
Replies: 1 comment 6 replies
-
This is an very expensive operation on linked lists, so it would not be suitable for the standard library. If you want to rotate a sequence then list may be the wrong data structure for you. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recently, I was working on KRYTOS, and while creating the Vigenère table,
I implemented my own circular shift function.
Upon exploring Gleam's standard library, I noticed that a
list.rotate
orlist.shift
function isn’t available yet,unlike in languages such as Rust, Julia, C++, Java, or Ruby.
This led me to think it could be a valuable addition to Gleam's stdlib !
Beta Was this translation helpful? Give feedback.
All reactions