Add `mergeFlipped`

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

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

The issue proposes mergeFlipped and the // operator for purescript-record, with examples but no source files or tests named. Start by reading the linked PR #83 and the package’s existing record merge implementation and tests. Done means the proposed operation and operator work for the shown record combinations and are covered by tests.

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

Mô tả

Add mergeFlipped and an infix operator //

As a user I'm typically more thinking in terms of mergeFlipped than merge, as I want to overwrite a record with some new fields. E.g. in Typescript I can do

const newRecord = { ...otherRecord, more: 23 }

and in dhall // is avaiable as a mergeFlipped operator:

{ home       = "/home/bill"
, privateKey = "/home/bill/.ssh/id_ed25519"
, publicKey  = "/home/blil/.ssh/id_ed25519.pub"
} // { home = "/home/john" }

So in Purescript I would also like to do the following and I think it makes for a nice addition to purescript-record:

person :: { age :: Int
, firstName :: Maybe String
, professional :: String
}
person = 
  { firstName: "John", professional: true } //
  { professional: "Software Engineer", age: 58 } // 
  { firstName: Just "Mike" }

I have created a PR to illustrate this #83

Ngôn ngữ chính
PureScript
Star
68
Fork
33
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

  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-record

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

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.