lean-ja / lean-ja/lean-by-example
`run_io` という term eleborator を紹介する (lakefile 専用らしい)
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
You can run arbitrary IO in a lakefile.lean via the run_io syntax. For example, you could derive the version of a package from a Git tag like so:
def getVersion : IO StdVer := do
let repo := GitRepo.mk __dir__
let some tag ← repo.findTag?
| return v!"0.0.0"
let .ok ver := StdVer.parse tag
| return v!"0.0.0"
return ver
package mypkg where
version := run_io getVersion
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked Zulip discussion and the lakefile.lean example in the issue, focusing on the run_io syntax and its lakefile-only context. Done means adding a clear introduction to this term elaborator with the provided package-version example.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100