lean-ja / lean-ja/lean-by-example
#reduce と #eval の結果が一致するときでも両者の中身が異なることを説明する
Open
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
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
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