Traverse Lens Documentation Needs more Examples
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- fsharp
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với tài liệu về lens và các unit test được tham chiếu trong issue, sử dụng ví dụ tuple F# được cung cấp làm trường hợp tái hiện nhỏ nhất. Tài liệu hóa các ví dụ cho thấy List.traverse có kiểu so với traverse đa hình, đồng thời giải thích rằng items là bí danh của traverse. Hoàn thành khi tài liệu và các test minh họa làm rõ sự khác biệt đối với các model Record hoặc Tuple.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- F#
- Star
- 942
- Fork
- 106
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fsprojects/FSharpPlus
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fsprojects/FSharpPlus#683 · 1 bình luận · 2 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
fsprojects/FSharpPlus#678 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fsprojects/FSharpPlus#644 ·
-
breaking change F#+ v2.0
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
fsprojects/FSharpPlus#643 ·
-
lens type signatureĐang mởbreaking change F#+ v2.0
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
fsprojects/FSharpPlus#641 ·
Tất cả issue của fsprojects/FSharpPlus
Issue tương tự
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Перевод устарел
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Incorrect Link in README.mdCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
flameshot-org/flameshot#4996 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
docs(evals): note CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS for headless eval runs that use workflowsĐang mởgood first issue needs-triage priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
melodic-software/claude-code-plugins#7022 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày