Semigroup Result instance?
Chưa có ai nhận issue này.
- #101 của @np — đã đóng, không merge
Đá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
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- testing
Hướng nghiên cứu
Read the proposed Semigroup and Monoid instances in the issue body and the linked pull request #101 for prior discussion. Decide whether combining Result values this way fits the library’s API and supports the shown QuickCheck use case; the issue does not name implementation files or tests, so locate the existing Result definitions and instances before judging completion.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
How would we feel about the following?
instance semigroupResult :: Semigroup Result where
Success <> r = r
Failed str <> _ = Failed str
instance monoidResult :: Monoid Result where
mempty = Success
This is a use case I have in mind
log "fromRotationMatrix avoids instability issues when the quaternion has one very small component"
quickCheck \(VerySmallNum e) a b c ->
let
testWith p' =
let
p = Rotation.fromQuaternion p'
q = unsafePartial (Rotation.fromRotationMatrix (Rotation.toRotationMatrix p))
in
rApproxEq p q
<?> show { p, q }
in
fold
[ testWith (Quaternion e a b c)
, testWith (Quaternion a e b c)
, testWith (Quaternion a b e c)
, testWith (Quaternion a b c e)
]
Of course I could rewrite this test to call quickCheck four times instead, but I think the instance makes sense, and I think it would be nice to allow writing tests this way. Additionally, if generating random values for a given type is expensive, being able to combine Result values in this way could let you cut down the number of random values you need to generate, since you don't need to call quickCheck as many times.
- Ngôn ngữ chính
- PureScript
- Star
- 108
- Fork
- 42
- 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-quickcheck
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
purescript/purescript-quickcheck#136 · 1 bình luận ·
-
Lazy List Arbitrary InstanceCó thể đã có người làm @eviefp đã nhận 2207 ngày trước. Đang mởtype: enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
purescript/purescript-quickcheck#111 · 2 bình luận · 2 reaction ·
-
type: documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 55/100
-
purs-0.15 type: breaking change
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
purescript/purescript-quickcheck#104 · 12 bình luận ·
-
ShrinkingĐang mởtype: enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
purescript/purescript-quickcheck#103 · 6 bình luận · 4 reaction ·
Tất cả issue của purescript/purescript-quickcheck
Issue tương tự
-
[prefer-expect-resolves] autofix leaves a stray ")" when the awaited expression is parenthesizedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jest-community/eslint-plugin-jest#2052 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
johanhaleby/occurrent#1505 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jeanibarz/knowledge-base-mcp-server#1262 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
future-agi/future-agi#4092 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày