leanprover / leanprover/fp-lean

UnusedVariable warning in Point3D pattern matching example (depth function) 1.5.1. Pattern Matching

Open Beginner friendly
#298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
192
Forks
73
PR merge metrics
No merged PRs in 30d

Description

In the section 1.5.1. covering structures and pattern matching, the definition for depth binds unused variables (h and w), triggering a Lean 4 linter warning (UnusedVariables)

Code:
```lean def depth (p : Point3D) : Float := match p with | { x := h, y := w, z := d } => d
There maybe, the unused variables can be written with an underscore, like _h and _w.

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 with the section 1.5.1 pattern-matching example containing the depth definition for Point3D. Check the example with the Lean 4 linter, update the unused h and w bindings as described, and confirm the UnusedVariables warning is gone.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.