lean-ja / lean-ja/lean-by-example
Functional Programming in Lean の内容をカバーする
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
Codex による概要
• 結論: 完全にはカバーできていません。
Lean by Example はかなり広く重なっていますが、性格が「通読型の関数型プログラミング入門」ではなく「Lean の機能・型・タクティックを例で引けるリファレンス」に近いです。
Functional Programming in Lean の現行公式目次は、基本文法、IO/Lake、命題と添字、型クラス、Monad、Functor/Applicative、Monad Transformer、依存型プログラミング、性能と証明、という構成で
す。Lean by Example 側は /C:/Users/11325/lean-by-example/booksrc/SUMMARY.md:119 を見る限り、型クラス、主要データ型、IO、タクティック、termination などはかなりあります。
足りない主な内容は以下です。
-
Monad Transformers 周りが大きく不足
FP in Lean には ReaderT/StateT/ExceptT/OptionT、transformer stack の順序、MonadLift 系、do 構文の early return、for/break/continue、可変変数の脱糖などの章があります。Lean by Example に
は /C:/Users/11325/lean-by-example/LeanByExample/Type/StateM.lean:1 はありますが、このまとまった内容はほぼありません。 -
Lake/プロジェクト作成の実践部分が薄い
FP in Lean の “Hello, World!” 章は、実行、段階的説明、プロジェクト作成、cat の実装を扱います。Lean by Example には /C:/Users/11325/lean-by-example/LeanByExample/Type/IO.lean:1 と lean
--run の例はありますが、Lake プロジェクトを作ってビルドする流れはあまり本文化されていません。 -
依存型プログラミングの大きな作例が不足
Vector、Fin、Subtype、帰納族はありますが、FP in Lean の “Universe Design Pattern” や “Typed Queries” のような、依存型を使って小さな DSL/アプリ設計をする章が不足しています。対応する基礎
は /C:/Users/11325/lean-by-example/LeanByExample/Declarative/Inductive.lean:42 や /C:/Users/11325/lean-by-example/LeanByExample/Type/Vector.lean:1 にあります。 -
性能・証明・配列アルゴリズムの統合例が不足
FP in Lean は tail recursion、等価性証明、配列と停止性、bounded numbers、in-place insertion sort、特殊な実行時表現をまとめて扱います。Lean by Example には /C:/Users/11325/lean-by-
example/LeanByExample/Modifier/TerminationBy.lean:1、/C:/Users/11325/lean-by-example/LeanByExample/Modifier/DecreasingBy.lean:1、/C:/Users/11325/lean-by-example/LeanByExample/Type/
Array.lean:1、/C:/Users/11325/lean-by-example/LeanByExample/EXTRA/SelectionSort.lean:1 はありますが、FP in Lean の insertion sort + array mutation + proof + runtime representation ほど
一続きにはなっていません。 -
標準型の実行時表現の説明が一部不足
FP in Lean は Nat、Int、BitVec、UInt*、USize、Char、String、Array、Sort、証明項の実行時表現まで一覧化しています。Lean by Example には Float や Array など個別ページはありますが、この観
点の網羅表はありません。
まとめると、Lean by Example は FP in Lean の 基礎トピックの多くを断片的にはカバーしています。特に型クラス、Functor/Applicative/Monad、IO、添字アクセス、命題・タクティック、停止性あたりは
重なりが大きいです。ただし Monad Transformers、依存型プログラミングの大型作例、性能と証明を組み合わせた章、Lake を使うアプリ開発の流れは明確に足りません。
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 by reading SUMMARY.md around line 119 and the referenced examples in Type/StateM.lean, Type/IO.lean, Declarative/Inductive.lean, Type/Vector.lean, and the termination, array, and sorting files. Compare them with the identified Functional Programming in Lean topics, then define and document the missing coverage; done means the major gaps are addressed as a coherent learning path.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100