lean-ja / lean-ja/lean-by-example

`run_io` という term eleborator を紹介する (lakefile 専用らしい)

Open Beginner friendly
#2,259 2 comments 0 reactions 0 assignees View on GitHub

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

https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/Package.20version.20from.20git.20tag.3F/near/566460301

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.