Zulip Chat Archive

Stream: batteries

Topic: List.removeNth vs List.eraseIdx


Yury G. Kudryashov (Apr 28 2024 at 06:13):

It looks like docs#List.removeNth from Std is the same as docs#List.eraseIdx from core.

Yury G. Kudryashov (Apr 28 2024 at 06:14):

@Mario Carneiro What do you prefer to do? Drop Std version (probably, making it a deprecated alias first)? Something else?

Yury G. Kudryashov (May 03 2024 at 15:17):

@Mario Carneiro Ping here.

Yury G. Kudryashov (May 03 2024 at 15:18):

#12388 adds lemmas about eraseIdx to Mathlib. Should I leave it as is, or migrate to removeNth?

Yury G. Kudryashov (May 03 2024 at 15:22):

#xy: I want to redefine docs#Finset.offDiag based on

def offDiag (l : List α) : List (α × α) :=
  l.enum.bind fun nx  map (Prod.mk nx.2) <| l.eraseIdx nx.1

Mario Carneiro (May 03 2024 at 17:11):

Drop the std version makes sense

Yury G. Kudryashov (May 03 2024 at 22:08):

OK, I'll prepare a PR over the weekend.

Yury G. Kudryashov (May 04 2024 at 15:28):

std4#781 #12660


Last updated: May 02 2025 at 03:31 UTC