-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(Data/UInt): deprecate UInt8.isUpper etc #13521
Conversation
This seems more semantically suspect than what is being deprecated. Either |
Note that the original purpose of these functions is for being able to efficiently process large (validated) ASCII byte strings without the size or decoding cost of UTF-8 and unicode-aware string processing. Arguably this should be replaced by |
Co-authored-by: Richard Osborn <[email protected]>
I'm pretty frustrated here, to be honest. I thought making this PR would be a helpful compromise rather than just deleting this section outright, because you care about deprecating things before deletion. |
I agree that an Ascii type would be better than pretending |
I don't really agree they should be deprecated at all, they serve a useful purpose. The rust function puts
This was added precisely because I had a project that was measurably improved by the use of this function. UTF-8 decoding isn't free, especially when it's done in the lean interpreter. And much more important than the 32->8 bit part is not having to handle multilingual case-folding. |
@digama0, I agree these functions could well be useful to someone. However they should not live in Mathlib. |
I would be content to change the deprecation message to instead not give a replacement suggestion, and to add a module doc advising that if any downstream users are using these that they should find a new home for them (possibly at the point of use) because they will be removed from Mathlib. |
Go on, just delete the section outright. |
Could you elaborate on this? Putting things in a new namespace seems like an easy way to get out of the way of core |
I am confused. Isn't the point of this exercise to get the material which is only relevant for program verification and which doesn't involve mathlib notions and which is irrelevant for mathematics, out of mathlib? Why do we want to put it in a new namespace rather than putting it in the hands of the Lean developers? It's only there at all because of some historical coincidence. |
This sounds better than the current state of this PR to me, but it would be good to wait to see what Mario thinks about it. |
I will be moving
Char.toUInt8
andChar.ofUInt8
up to Lean shortly. (Done now in leanprover/lean4#4348.) This deprecates some functions that have bad semantics: if you want to treat your UInt8 as a Char, do that explicitly!This will be a short deprecation cycle, as we'd like to get this stuff out of Mathlib asap.