Support `PartialEq` and `PartialOrd`

Đang mở
#285 9 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
22/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-api-design

Hướng nghiên cứu

Read the proposed PartialEq and PartialOrd class definitions in the issue and compare them with the Rust traits linked there. Then inspect the existing ordering and equality classes in PureScript Prelude to identify design and compatibility questions; done would require an agreed class hierarchy and complete API proposal, but the thread has had no comment for years.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

See Rust for example:

-- symmetric: a `eq` b == b `eq` a
-- transitive: a `eq` b == b `eq` c == a `eq` c
class PartialEq a where
  eq :: a -> a -> Boolean
  
notEq :: forall a. PartialEq a => a -> a -> Boolean
notEq = not <<< eq

-- reflexive a `eq` a
class PartialEq a <= Eq a

-- pre order
class PartialEq <= PartialOrd a where
  pcompare :: a -> a -> Maybe Ordering
  lt :: a -> a -> Boolean
  lte :: a -> a -> Boolean
  gt :: a -> a -> Boolean
  gte :: a -> a -> Boolean

-- total order
class (Eq a, PartialOrd a) <= Ord a where
  compare :: a -> a -> Ordering
Ngôn ngữ chính
PureScript
Star
168
Fork
90
Merge trung bình
3 ngày 1 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của purescript/purescript-prelude

Tất cả issue của purescript/purescript-prelude

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.