lean4-htt/tests
Markus Himmel dca8d6d188
refactor: discipline around arithmetic of String.Pos.Raw (#10713)
This PR enforces rules around arithmetic of `String.Pos.Raw`.

Specifically, it adopts the following conventions:

- Byte indices ("ordinals") in strings should be represented using
`String.Pos.Raw`
- Amounts of bytes ("cardinals") in strings should be represented using
`Nat`.

For example, `String.Slice.utf8ByteSize` now returns `Nat` instead of
`String.Pos.Raw`, and there is a new function `String.Slice.rawEndPos`.

Finally, the `HAdd` and `HSub` instances for `String.Pos.Raw` are
reorganized. This is a **breaking change**.

The `HAdd/HSub String.Pos.Raw String.Pos.Raw String.Pos.Raw` instances
have been removed. For the use case of tracking positions relative to
some other position, we instead provide `offsetBy` and `unoffsetBy`
functions. For the use case of advancing/unadvancing a position by an
arbitrary number of bytes, we instead provide `increaseBy` and
`decreaseBy` functions. For
offsetting/unoffsetting/advancing/unadvancing a position `p` by the size
of a string `s` (resp. character `c`), use `s + p`/`p - s`/`p + s`/`p -
s` (resp. `c + p`/`p - c`/`p + c`/`p - c`).
2025-10-09 07:47:45 +00:00
..
bench chore: rename Stream to Std.Stream (#10645) 2025-10-02 15:25:56 +00:00
compiler refactor: discipline around arithmetic of String.Pos.Raw (#10713) 2025-10-09 07:47:45 +00:00
elabissues
ir
lake feat: lake: allowImportAll configuration option (#9855) 2025-10-08 02:47:35 +00:00
lean refactor: discipline around arithmetic of String.Pos.Raw (#10713) 2025-10-09 07:47:45 +00:00
pkg fix: simp should not pick up inaccessible definitional equations (#10696) 2025-10-08 12:48:35 +00:00
playground feat: linear-size DecidableEq instance (#10152) 2025-09-03 06:31:49 +00:00
plugin
simpperf
.gitignore
common.sh
lakefile.toml
lean-toolchain