Improve documentation for Control.Monad.State
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- documentation
Hướng nghiên cứu
Find the documentation for State in Control.Monad.State and compare it with the MonadState documentation in Control.Monad.State.Class. Add an explanation of what State means beyond its type alias, including its relationship to MonadState. Done when readers can understand that relationship from the State documentation; the issue names no specific files or tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The documentation for State in Control.Monad.State gives State's type definition as as type StateT s Identity, and says that "The State monad is a synonym for the StateT monad transformer, applied to the Identity monad."
That documentation simply repeats whats' in the type signature, but I have to assume that I'm not alone in finding the type signature opaque. Understanding it requires studying StateT and Identity, and then figuring out what the implications of their combination are.
There's information that seems relevant in the documentation for MonadState in Control.Monad.State.Class, but it's not easy to figure out what the relationship is between MonadState and StateT s Identity. It doesn't seem as if one is normally supposed to use MonadState directly, in any event.
Purescript by Example has some discussion of the State monad. It's helpful, but it's fairly superficial and didn't answer my questions. I didn't find anything helpful for my needs in Jordan's Reference, though it's possible that I haven't looked in the right place. Instead I've been studying Haskell resources to learn about Haskell's Control.Monad.State, which is obviously the model for Purescript's State. However, then one has to worry about possible differences in corner cases or even more substantial semantical features. This becomes a real issue when I translate Haskell code into Purescript and get an error that isn't due to obvious differences between the languages. (e.g. it's obvioius using (x, y) instead of Tuple x y is a mistake). Then it's not clear whether I made a mistake, or whether there's difference in the semantics of the two State monads. Since it's hard to understand the documentation for Purescript's State, figuring out whether there's a difference isn't easy. (The documentation for Haskell's State is confusing, too, but the docs are more detailed, and there are lots of other things one can read about Haskell's State.)
Normally, I'd expect that more explanation of something like the State monad might be found in the package documentation. However, since the Control.Monad.* modules are part of the transformers package, and there are lots of other modules in that package, I can understand why the package documentation doesn't say anything about particular modules or groups of modules.
However, I think there needs to be documentation of State that goes beyond it's type alias definition. One small thing that might help would be a brief explanation within the documentation for State of its relationship to MonadState.
Thanks!
- Ngôn ngữ chính
- PureScript
- Star
- 72
- Fork
- 43
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
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 purescript/purescript-transformers
-
MonadAsk is over constrainedĐang mởtype: breaking change
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
purescript/purescript-transformers#144 · 2 bình luận ·
-
type: documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 28/100
purescript/purescript-transformers#129 · 6 bình luận ·
-
type: enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
purescript/purescript-transformers#123 · 4 bình luận ·
-
maybeToExceptTĐang mởtype: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
-
type: documentation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
purescript/purescript-transformers#117 · 6 bình luận ·
Tất cả issue của purescript/purescript-transformers
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
kubescape/node-agent#1099 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[workshop-sim] Improve: Provide a concrete example and activity checks in agentic intro (step 5)Đang mởfeedback simulation workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
githubnext/gh-aw-workshop#5715 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
README Quick Start query command fails, and doctor points to a missing Prerequisites sectionĐang mởdocumentation type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-multi-tenancy p1-recommended technical-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs: 2 broken linksĐang mởBug pulumi/pulumi-terraform-bridge R2 S2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
pulumi/pulumi-terraform-bridge#3713 ·
Maintainer thường phản hồi trong vòng 1 ngày