lean4-htt/stage0/src
Sebastian Ullrich ddc4cf0a97
refactor: private field use in Meta.Context (#9468)
This PR resolves an issue where the `Meta.Context.configKey` field is
private but we still want to use the constructor of the structure for
setting other fields, which would be prevented by the module system
checks:
```lean
structure Context where
  private config    : Config               := {}
  private configKey : UInt64               := config.toKey
...

def ContextInfo.runMetaM (info : ContextInfo) (lctx : LocalContext) (x : MetaM α) : IO α := do
  -- cannot call private constructor of `Meta.Context`!
  (·.1) <$> info.runCoreM (x.run { lctx := lctx } { mctx := info.mctx })
```
Instead, the private field is extracted into an (existing) structure
that applies its default value:
```lean
/-- Configuration with key produced by `Config.toKey`. -/
structure ConfigWithKey where
  private mk ::
  config : Config := {}
  key    : UInt64 := config.toKey
  
structure Context where
  keyedConfig : ConfigWithKey := default
```
Thus `Context`'s constructor remains public without exposing a way to
set `key` directly.
2025-07-23 08:16:44 +00:00
..
bin chore: update stage0 2025-02-10 11:58:06 +00:00
cmake chore: update stage0 2025-04-07 15:22:09 +00:00
include/lean chore: update stage0 2025-06-28 12:09:50 +02:00
initialize chore: update stage0 2025-07-11 08:18:55 +00:00
kernel chore: update stage0 2025-07-02 18:26:42 +00:00
lake chore: update stage0 2025-05-14 16:03:07 +00:00
Lean chore: update stage0 2025-06-24 05:02:20 +00:00
library chore: update stage0 2025-07-16 02:48:16 +00:00
runtime chore: update stage0 2025-07-22 09:47:42 +00:00
shell chore: update stage0 2025-04-21 18:40:11 +02:00
util chore: update stage0 2025-07-11 08:18:55 +00:00
cadical.mk chore: update stage0 2025-05-03 00:16:43 +00:00
CMakeLists.txt chore: update stage0 2025-07-21 05:32:04 +00:00
config.h.in chore: update stage0 2025-04-03 03:26:05 +00:00
githash.h.in
lakefile.toml.in chore: update stage0 2025-07-21 05:32:04 +00:00
lean-toolchain chore: update stage0 (#3041) 2023-12-08 12:14:47 +00:00
lean.mk.in chore: update stage0 2025-03-17 19:01:29 +00:00
stdlib.make.in chore: update stage0 2025-07-21 05:32:04 +00:00
stdlib_flags.h refactor: private field use in Meta.Context (#9468) 2025-07-23 08:16:44 +00:00
version.h.in chore: update stage0 2025-03-12 10:19:24 +00:00