leanprover / leanprover/reference-manual

Compare `have`, `let`, `haveI`, `letI`

Open
#472 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

doc-request
Dominant language
Lean
Stars
129
Forks
67
Avg merge
1d 15h
Merged PRs (30d)
16

Description

What question should the reference manual answer?

The difference between let and have is something that most Lean users need to learn about at some point. The constructs haveI and letI are less well-known and also much less well-understood. This is made worse by the fact that haveI meant something completely different in Lean 3 (it reset the instance cache), and so some users still use haveI today in situations where they should just be using have instead. The docstrings for haveI and letI explain what sets them apart from have and let, but they do so using very low-level language (let_fun, which the reference manual's jump-to box doesn't even find), so unless you know a lot about Lean the explanation isn't really helpful.

So the questions are

  • What is the difference between have, let, haveI, letI?
  • When should I use which (ideally with examples)?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing docstrings for haveI and letI and the surrounding reference-manual material. Compare have, let, haveI, and letI from the user's perspective, then update the reference manual so it explains when to use each and includes examples answering both questions.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.