Zulip Chat Archive
Stream: lean4
Topic: mkForall vs forallE
Eric Wieser (Feb 10 2024 at 09:33):
The docs at docs#Lean.mkForall say that .forallE x t b bi
is the preferred form. Is this still the case, and if so, should the former be deprecated?
Joachim Breitner (Feb 10 2024 at 11:48):
No idea about whatโs preferred and the evolution, but I found that I still reach for mkโฆ
if type inference isnโt good enough to allow .forallE
, and for some reason I shied away fromExpr.forallE
.
Tomas Skrivan (Feb 10 2024 at 12:03):
If I remember correctly all the mk...
functions were there before the leading dot notation was implemented. So .forallE
should still be preferred but I have no idea if the mk variants should be deprecated or not. I personally do not use them and use Expr...
when type inference fails.
Mario Carneiro (Feb 10 2024 at 12:08):
I've used mkApp
occasionally but would not mind seeing it go, I use the dot-notation constructors most of the time
Eric Wieser (Feb 10 2024 at 12:09):
Should mkApp2
be renamed to .app2
for consistency, if mkApp
were eliminated?
Max Nowak ๐ (Feb 10 2024 at 14:19):
.app is a constructor, .app2 would be a function, I feel like that might cause some confusion.
Max Nowak ๐ (Feb 10 2024 at 14:20):
Iโd rather see mkApp take an array than having .app2
Marcus Rossel (Feb 10 2024 at 14:23):
IIRC a benefit of the mk...
functions was also that they computed the data
field for each constructor, which isn't necessary anymore.
Eric Wieser (Feb 10 2024 at 14:24):
Max Nowak ๐ said:
Iโd rather see mkApp take an array than having .app2
That's docs#Lean.mkAppN
Eric Wieser (Feb 10 2024 at 14:24):
Max Nowak ๐ said:
.app is a constructor, .app2 would be a function, I feel like that might cause some confusion.
Maybe, but we have Nat.add
(not a constructor) and Nat.succ
(a constructor) etc, so I don't think this is a particularly strong argument
Kyle Miller (Feb 10 2024 at 18:10):
Max Nowak ๐ said:
.app is a constructor, .app2 would be a function, I feel like that might cause some confusion.
All the mkApp2
-mkApp10
functions are @[match_pattern]
s at least, so you can use them as if they are (composites of) constructors in patterns.
Last updated: May 02 2025 at 03:31 UTC