lean-ja / lean-ja/lean-by-example
Prod.fst や .snd のデラボレータを変更する例。[app_delab]使用例
Open
Nobody has claimed this yet.
コード例
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
Zulip: >
Infoview .1 and .2
import Mathlib.Tactic
variable (x : ℕ × ℕ)
#check x.1
#check x.fst
open Lean PrettyPrinter Delaborator
/-- Delaborator for `Prod.fst x` as `x.fst`. -/
@[app_delab Prod.fst]
def delabProdFst : Delab := withOverApp 3 do
let x ← SubExpr.withAppArg delab
`($(x).$(mkIdent `fst))
/-- Delaborator for `Prod.snd x` as `x.snd`. -/
@[app_delab Prod.snd]
def delabProdSnd : Delab := withOverApp 3 do
let x ← SubExpr.withAppArg delab
`($(x).$(mkIdent `snd))
#check x.1
#check x.2
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 with the Lean code example in the issue and inspect the repository's existing example pages to find the appropriate location. Done means the Prod.fst and Prod.snd @app_delab examples are included and the documentation build accepts the snippet.
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
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100