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

#reduce と #eval の結果が一致するときでも両者の中身が異なることを説明する

Open
#1,357 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

素朴なフィボナッチ数列に対して、#reduce は .brecOn を使用するため #eval よりも高速で動作し、違いが生じる。

また Array や String のような実装がコンパイラによってオーバーライドされているような型の場合は、#reduce の方が遅くなることが期待される。基本的には #eval の方が高速になる。

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

No file or test is named; first locate the documentation or example section covering #reduce and #eval, then read the surrounding explanation. Done means clearly explaining why their internals and performance can differ, including the Fibonacci case and the Array/String compiler-override caveat.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.