Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: modify MonadStats to not extend parents multiple times #169

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

kmill
Copy link
Contributor

@kmill kmill commented Oct 19, 2024

MonadStats was extending MonadLiftT twice, but the two parents were defeq. This was a hack to get around the fact that the parent instances were providing MonadLiftT instances rather than a MonadLift instance, breaking MonadLiftT inference.

This changes it to not extend MonadLiftT, instead embedding it as a field, and then writing an explicit MonadLift instance. While it could still extend the MonadLiftT instance, it is better this way because no one should be providing MonadLiftT instances.

This is motivated by lean4#5770, which will log warnings when structures extend parents multiple times.

MonadStats was extending `MonadLiftT` twice, but the two parents were defeq. This was a hack to get around the fact that the parent instances were providing `MonadLiftT` instances rather than a `MonadLift` instance, breaking `MonadLiftT` inference.

This changes it to *not* extend `MonadLiftT`, instead embedding it as a field, and then writing an explicit `MonadLift` instance.

This is motivated by [lean4#5770](leanprover/lean4#5770), which will log warnings when structures extend parents multiple times.
@kmill kmill requested a review from JLimperg October 19, 2024 18:07
@JLimperg JLimperg added this pull request to the merge queue Oct 22, 2024
@JLimperg
Copy link
Collaborator

Looks good, thanks!

Merged via the queue into master with commit 9ac1294 Oct 22, 2024
2 checks passed
@JLimperg JLimperg deleted the kmill_nodup_parent branch October 22, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants