lean4-htt/src/Lean
Markus Himmel fa5d08b7de
refactor: use String.Slice in String.take and variants (#11180)
This PR redefines `String.take` and variants to operate on
`String.Slice`. While previously functions returning a substring of the
input sometimes returned `String` and sometimes returned
`Substring.Raw`, they now uniformly return `String.Slice`.

This is a BREAKING change, because many functions now have a different
return type. So for example, if `s` is a string and `f` is a function
accepting a string, `f (s.drop 1)` will no longer compile because
`s.drop 1` is a `String.Slice`. To fix this, insert a call to `copy` to
restore the old behavior: `f (s.drop 1).copy`.

Of course, in many cases, there will be more efficient options. For
example, don't write `f <| s.drop 1 |>.copy |>.dropEnd 1 |>.copy`, write
`f <| s.drop 1 |>.dropEnd 1 |>.copy` instead. Also, instead of `(s.drop
1).copy = "Hello"`, write `s.drop 1 == "Hello".toSlice` instead.
2025-11-18 16:13:48 +00:00
..
Compiler refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Data refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
DocString refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Elab refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
ErrorExplanations
Language chore: rename String.endPos -> String.rawEndPos (#10853) 2025-10-21 11:25:30 +00:00
LibrarySuggestions chore: tactics using library suggestions set the caller field (#11171) 2025-11-14 04:50:55 +00:00
Linter refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Meta refactor: extract functionality from Match.MatchEqs (#11236) 2025-11-18 10:02:10 +00:00
Parser refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
ParserCompiler chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
PrettyPrinter refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Server refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Util refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Widget chore: rename String.Range to Lean.Syntax.Range (#10852) 2025-10-21 07:32:25 +00:00
AddDecl.lean test: avoid testing colliding private inductives (#11041) 2025-11-01 11:47:52 +00:00
Attributes.lean chore: make declMetaExt persistent for shake (#11201) 2025-11-16 20:11:56 +00:00
AuxRecursor.lean feat: sparse casesOn constructions (#11072) 2025-11-05 15:49:11 +00:00
BuiltinDocAttr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Class.lean
Compiler.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
CoreM.lean perf: reduce amount of symbols in DLLs (#10864) 2025-10-21 09:00:56 +00:00
Data.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Declaration.lean chore: >6 month old deprecations (#10969) 2025-10-26 22:48:41 +00:00
DeclarationRange.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
DefEqAttrib.lean
DocString.lean
Elab.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
EnvExtension.lean
Environment.lean chore: move some material out of Init.Data.String.Basic (#10893) 2025-10-22 16:31:08 +00:00
ErrorExplanation.lean refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
ErrorExplanations.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Exception.lean feat: hint about inaccessible private declaration on dot notation failure (#10803) 2025-10-17 09:31:56 +00:00
Expr.lean chore: new module system adjustments for the Mathlib port (#11093) 2025-11-05 22:17:53 +00:00
ExtraModUses.lean chore: make declMetaExt persistent for shake (#11201) 2025-11-16 20:11:56 +00:00
HeadIndex.lean
Hygiene.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ImportingFlag.lean
InternalExceptionId.lean
KeyedDeclsAttribute.lean fix: some ExtraModUses (#10620) 2025-10-03 15:50:40 +00:00
LabelAttribute.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Level.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
LibrarySuggestions.lean feat: make set_library_suggestions persistent 2025-11-03 23:26:40 +11:00
Linter.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
LoadDynlib.lean refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
LocalContext.lean feat: new do elaborator, part 1: doElem_elab attribute (#11150) 2025-11-12 14:25:28 +00:00
Log.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Message.lean refactor: rename String.split to String.splitToList (#10822) 2025-10-18 12:12:54 +00:00
Meta.lean
MetavarContext.lean
Modifiers.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
MonadEnv.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Namespace.lean
Parser.lean feat: hexnum parser (#10716) 2025-10-08 21:12:03 +00:00
ParserCompiler.lean chore: make declMetaExt persistent for shake (#11201) 2025-11-16 20:11:56 +00:00
PrettyPrinter.lean perf: reduce amount of symbols in DLLs (#10864) 2025-10-21 09:00:56 +00:00
PrivateName.lean
ProjFns.lean
ReducibilityAttrs.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Replay.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ReservedNameAction.lean
ResolveName.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
Runtime.lean
ScopedEnvExtension.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Server.lean feat: revamp server logging (#10787) 2025-10-28 16:26:59 +00:00
Setup.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Shell.lean refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
Structure.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
SubExpr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Syntax.lean chore: rename Substring to Substring.Raw (#11154) 2025-11-16 09:30:04 +00:00
ToExpr.lean feat: support for Rat scientific literals (#10961) 2025-10-26 02:05:26 +00:00
ToLevel.lean
Util.lean feat: instantiate tactic parameter optimizer (#10916) 2025-10-23 01:22:33 +00:00
Widget.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00