leanprover-community / mathlib

  • Home
  • Zulip archive
  • API documentation
  • Lean web editor
  • Links

Zulip Chat Archive

Stream: general

Topic: left shift on lists


Chris Hughes (Jun 01 2018 at 16:31):

Is there a function on lists that rotates the elements of the list i.e [1, 2, 3, 4] -> [2, 3, 4, 1]?

Simon Hudon (Jun 01 2018 at 16:32):

For list xs, you can do it with drop 1 xs ++ take 1 xs

Kevin Buzzard (Jun 01 2018 at 18:11):

you'd better remember what you dropped :-)

Simon Hudon (Jun 01 2018 at 18:32):

yep! That's whattake 1 xs does


Last updated: May 02 2025 at 03:31 UTC

Theme Simple by wildflame © 2016 Powered by jekyll