leanprover-community / mathlib

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

Zulip Chat Archive

Stream: Is there code for X?

Topic: Swap List Element


Marcus Rossel (Jan 12 2021 at 13:06):

Is there code for swapping a list element à la:

[10, 20, 10, 30].swap 2 40 = [10, 20, 40, 30]

Mario Carneiro (Jan 12 2021 at 13:07):

that looks like update_nth

Mario Carneiro (Jan 12 2021 at 13:07):

what we call "swap" is exchanging the positions of two data elements


Last updated: May 02 2025 at 03:31 UTC

Theme Simple by wildflame © 2016 Powered by jekyll