Zulip Chat Archive

Stream: mathlib4

Topic: porting lazylist


Siddhartha Gadgil (Nov 19 2022 at 03:39):

I have made a PR at https://github.com/leanprover-community/mathlib4/pull/653

In Lean 4 functions like head that fall back to defaults have been renamed head!. For now I have not made the corresponding changes. Should I do so?

Mario Carneiro (Nov 19 2022 at 03:42):

The ! suffix does not mean that it falls back to a default, but rather that it panics in the undefined case

Mario Carneiro (Nov 19 2022 at 03:46):

headD is for if you have a provided default, and headI for if you want to return default without a panic

Siddhartha Gadgil (Nov 19 2022 at 03:47):

Thanks. Does that mean that the function should be headI.

Siddhartha Gadgil (Nov 19 2022 at 03:48):

I assume the priority is downstream dependencies, so best not to change the name. But I was checking.

Mario Carneiro (Nov 19 2022 at 07:21):

Names can be changed in downstream dependencies using #align. Don't be afraid to do renames, this is the best opportunity to do so

Siddhartha Gadgil (Nov 19 2022 at 07:35):

Done. There was in fact a #alignjust there in the synported file which I modified.


Last updated: Dec 20 2023 at 11:08 UTC