OneOf?
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
- 35/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
- backend
Hướng nghiên cứu
Start by reading the existing parser alternatives and error-combination operators in the library to see whether they already provide lazy, as-needed parsing. The issue includes a proposed oneOf implementation but names no files or tests; identify the relevant entry points and tests before deciding whether a new helper is needed. Done means establishing whether the helper exists or, if it does not, adding and testing the proposed behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Feels like we probably already have a oneOf function that can make sure that not all branches are evaluated at once (to ensure efficient as-needed parsing), since using alt naively can lead to really really slow decoding, but I honestly don't know where it is. Is there something I'm missing that already implements this?:
oneOf :: forall f a
. Foldable f
=> f (Foreign -> F a)
-> Foreign
-> F a
oneOf f js = go (fromFoldable f) js
where
go (read : xs) js = do
case runExcept (read js) of
Right pv -> pure pv
Left e -> do
case runExcept (go xs js) of
Right pv' -> pure pv'
Left e' -> throwError (e <> e')
go Nil _ = do
throwError $ pure (ForeignError "No more parsers to attempt in oneOf")
If not, I could PR this, but feels like it probably exists as a simple combination of some operators.
- Ngôn ngữ chính
- PureScript
- Star
- 64
- Fork
- 42
- Merge trung bình
- 2 ngày 6 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 tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
remove the use of `forget`Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
milind-soni/OpenMausBot#5829 ·
Maintainer thường phản hồi trong vòng 1 ngày