This PR defines `String.Slice.replace` and redefines `String.replace` to use the `Slice` version. The new implementation is generic in the pattern, so it supports things like `"education".replace isVowel "☃!" = "☃!d☃!c☃!t☃!☃!n"`. Since it uses the `ForwardSearcher` infrastructure, `String` patterns are searched using KMP, unlike the previous implementation which had quadratic runtime. As a side effect, the behavior when replacing an empty string now matches that of most other programming languages, namely `"abc".replace "" "k" = "kakbkck"`. |
||
|---|---|---|
| .. | ||
| bench | ||
| compiler | ||
| elabissues | ||
| ir | ||
| lake | ||
| lean | ||
| pkg | ||
| playground | ||
| plugin | ||
| simpperf | ||
| .gitignore | ||
| common.sh | ||
| lakefile.toml | ||
| lean-toolchain | ||