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

doc: Add module docstrings and info about ~q() #47

Merged
merged 4 commits into from
Jul 23, 2024
Merged

doc: Add module docstrings and info about ~q() #47

merged 4 commits into from
Jul 23, 2024

Conversation

eric-wieser
Copy link
Member

I'm sure much more could be written here, but this makes common patterns in mathlib a little more understandable from the vscode hovers alone.

@eric-wieser eric-wieser added the documentation Improvements or additions to documentation label Jul 14, 2024
Copy link

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstrings look otherwise accurate. Are you planning to put general explanations somewhere else?

Comment on lines +45 to +48
let ⟨1, ~q(Nat), ~q($n + 37)⟩ ← inferTypeQ e | return none
return some n
```
This is performing three sequential matches: first that `e` is in `Sort 1`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very sure this should be

Suggested change
let1, ~q(Nat), ~q($n + 37)⟩ ← inferTypeQ e | return none
return some n
```
This is performing three sequential matches: first that `e` is in `Sort 1`,
let0, ~q(Nat), ~q($n + 37)⟩ ← inferTypeQ e | return none
return some n
```
This is performing three sequential matches: first that `e` is in `Type 0`,

See eg https://github.com/leanprover-community/mathlib4/blob/caed7dd3719a09e209e19209a6f342885e278ea1/Mathlib/Tactic/Positivity/Basic.lean#L335-L337

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That example is different, there you have α : Q(Type u), but the return type of inferTypeQ is Q(Sort u).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you are right

@eric-wieser
Copy link
Member Author

Are you planning to put general explanations somewhere else?

No, but I figured docstrings somewhere now was better than a plan much later.

@YaelDillies
Copy link

Then this looks good to me, but I don't have merge rights

@eric-wieser
Copy link
Member Author

@dwrensha, could you take a quick look too? I seem to remember you writing some Qq code in the past.

If it looks good to you, I'll go ahead and merge.

@dwrensha
Copy link
Member

Looks good to me. Thanks for doing this!

@eric-wieser eric-wieser merged commit 01ad339 into master Jul 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants