Zulip Chat Archive
Stream: lean4
Topic: StateM and Result not universe polymorphic
Jakob von Raumer (Feb 10 2025 at 12:44):
Is there a reason that lots of the monads, e.g. StateM
and EStateM
are not fully universe polymorphic?
Markus Himmel (Feb 10 2025 at 12:53):
Cf. lean4#3010; I believe the status of the PR is basically "increasing universe polymorphism is a double-edged sword because it can cause elaboration problems at some unknown time in the future, and there is no need for this within the Lean repository, so the FRO has been hesitant to pull the trigger and doesn't plan to invest time into this at the moment"
Jakob von Raumer (Feb 10 2025 at 13:19):
Thanks, at least I'm not the only one with the issue :sweat_smile:
Eric Wieser (Feb 10 2025 at 14:49):
I thought the status of the PR was just "the benchmark looks too good to be true"?
Eric Wieser (Feb 10 2025 at 17:13):
Though unfortunately now that Batteries is proving stuff about EStateM, things are starting to rot
Kim Morrison (Feb 10 2025 at 21:24):
I think Markus has just updated the status..:-)
Eric Wieser (Feb 10 2025 at 22:28):
increasing universe polymorphism is a double-edged sword because it can cause elaboration problems at some unknown time in the future,
Do we have any reason to believe this?
Eric Wieser (Feb 10 2025 at 22:28):
And there is no need for this within the Lean repository
Doesn't lake
make its own universe-polymorphic copy?
Ruben Van de Velde (Feb 10 2025 at 22:29):
We had that weird issue with the enormous slowdowns in mathlib recently, didn't we? Not sure if that counts as "elaboration problems"
Eric Wieser (Feb 10 2025 at 22:34):
All the mathlib cases were I believe ones where the universe variables were instantiated with max u v
or similar, lean4#3010 in practice is only going to instantiate with free variables. Of course someone can write crazy code that does otherwise, but even then EStateM is a low level metaprogramming tool that is pretty far away from the kind of problem mathlib has.
Last updated: May 02 2025 at 03:31 UTC