Traverse Lens Documentation Needs more Examples
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- fsharp
調査の方向性
まず issue で参照されている lens のドキュメントと単体テストを確認し、提供されている F# のタプル例を最小の再現として使います。型付きの List.traverse と多相の traverse を示す例をドキュメント化し、items が traverse のエイリアスであることを説明します。完了条件は、ドキュメントと例示的なテストによって、Record または Tuple モデルにおける違いが明確になることです。
索引モデルが issue の本文から書いたものです。
説明
Description
The documentation around using a lens to update a collection type within a Record or other data structure could be clearer.
Repro steps
- Install FSharpPlus and try to run the code below:
#r "nuget: FSharpPlus"
open FSharpPlus
open FSharpPlus.Lens
open FSharpPlus.Data
let data = (1, ["a";"b";"c"])
// Simple working example
let result1 = over (_2 << List.traverse) String.toUpper data
// The first thing one might try based on the documentation only to be greeted with
// mystifying compiler error
let result2 = over (_2 << traverse) String.toUpper data
Expected behavior
Documentation should remind the user that when trying to use items or traverse as part of a lens function composition, they should reference the typed version of traverse that matches their data structure. It would also be helpful to note that items is just an alias of traverse.
Actual behavior
All documentation examples use the polymorphic traverse function. Even the unit tests barely provide a decent example since the one example use of traverse is with nested lists in lists. I would image that most real world use of traverse would involve a Record or Tuple as the top level Model object (good old Elmish) and if one is just skimming through the tests trying to learn about lenses, they might not make the connection.
Known workarounds
Bang your head against the compiler until you gain insight.
Related information
- Windows 10 / WSL Ubuntiu
- .CoreCLR 6.0
Next Steps
I do not mind creating a PR to update the docs and add some more tests that are basically just examples more so than anything that covers a special corner case. Just let me know if the team is interested in making the changes and I will do the work.
- 主要言語
- F#
- スター
- 941
- フォーク
- 106
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fsprojects/FSharpPlus のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#683 · コメント 1 件 · リアクション 2 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#678 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#644 ·
-
breaking change F#+ v2.0
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
fsprojects/FSharpPlus#643 ·
-
lens type signatureオープンbreaking change F#+ v2.0
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
fsprojects/FSharpPlus#641 ·
fsprojects/FSharpPlus の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
langchain-ai/docs#6255 ·
メンテナーはふだん 1 日以内に返信
-
detectors enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
SM260845/readme-gen#1 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
angular/angularfire#3774 ·
メンテナーはふだん 2 日以内に返信
-
good first issue help wanted opensource september
難易度 1/5 1時間未満 初心者へのやさしさ 88/100