lean4-htt/src
JovanGerb e5e5a4d2e0
chore: fix the MonadStore type classes, with semiOutParam (#4205)
The type class `MonadStore1` and friends have an outParam, which should
not be an outParam, because there are multiple possible values for this
parameter. At this function
[fetchOrCreate](1382e9fbc4/src/lake/Lake/Load/Main.lean (L196C49-L196C63)),
there are multiple stacked `StateT` monad transformers that each give a
different instance to `MonadStore1`. It is an implementation detail of
type class synthesis which instance is found. This particular type class
synthesis fails when the unused instance
`Lake.instMonadStore1OfMonadDStoreOfFamilyOut` is set to a lower
priority, because then the synthesis order happens to go differently, so
the wrong instance is found.

Replacing the outParam with a semiOutParam solves this issue. Thus, we
make a new type class `MonadStore1Of`, which is the same, but with a
semiOutParam. This follows the design of `MonadState` and
`MonadStateOf`.

However, then it turns out that the instance cannot anymore be
synthesised.

There are two instances for `MonadStore1`:
```
instance [MonadDStore κ β m] : MonadStore1 k (β k) m
instance [MonadDStore κ β m] [FamilyOut β k α] : MonadStore1 k α m 
```
The first one is problematic during unification, especially when `β`
should be instantiated as a constant function. We make the second one
sufficient by adding an instance for the general type family:
```
/-- The general type family -/
instance (priority := low) : FamilyDef Fam a (Fam a) where
  family_key_eq_type := rfl
```
So then we can get rid of the first instance.
2024-05-24 02:09:07 +00:00
..
bin
cmake
include/lean feat: IO.TaskState (#4097) 2024-05-10 23:04:54 +00:00
Init perf: faster Nat.testBit (#4188) 2024-05-23 01:34:40 +00:00
initialize
kernel feat: propagate maxHeartbeats to kernel (#4113) 2024-05-09 17:44:19 +00:00
lake chore: fix the MonadStore type classes, with semiOutParam (#4205) 2024-05-24 02:09:07 +00:00
Lean fix: ensure incremental commands and tactics are reached only on supported paths (#4259) 2024-05-23 17:57:42 +00:00
library fix: segfault in old compiler due to noConfusion assumptions (#2903) 2024-05-10 01:38:38 +00:00
runtime feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
shell fix: do not dllexport symbols in core static libraries (#3601) 2024-03-15 11:58:34 +00:00
util chore: move trace.cpp to kernel (#4014) 2024-04-28 17:24:48 +00:00
CMakeLists.txt chore: reset LEAN_VERSION_IS_RELEASE 2024-05-23 12:28:24 +02:00
config.h.in
githash.h.in
Init.lean feat: grind normalization theorems (#4164) 2024-05-14 19:19:38 +00:00
lean-toolchain doc: VS Code dev setup (#2961) 2023-11-30 08:35:03 +00:00
Lean.lean feat: propagate maxHeartbeats to kernel (#4113) 2024-05-09 17:44:19 +00:00
lean.mk.in fix: do not dllexport symbols in core static libraries (#3601) 2024-03-15 11:58:34 +00:00
Leanc.lean fix: do not dllexport symbols in core static libraries (#3601) 2024-03-15 11:58:34 +00:00
stdlib.make.in fix: do not dllexport symbols in core static libraries (#3601) 2024-03-15 11:58:34 +00:00
stdlib_flags.h
version.h.in feat: System.Platform.target (#3207) 2024-01-24 12:11:00 +00:00