purescript / purescript-record

Functions for working with records and polymorphic labels
BSD 3-Clause "New" or "Revised" License
69 stars 31 forks source link

Override existing fields with Record.Builder.merge and Record.Builder.union #73

Closed kl0tl closed 3 years ago

kl0tl commented 3 years ago

This pull request updates Record.Builder.merge and Record.Builder.union so that they behave more like Record.merge and Record.union: fields from the argument override those of the record being built in case of overlaps.

I also added a Record.Builder.flip function that can be used with both Record.Builder.merge and Record.Builder.union instead of renaming the existing Record.Builder.merge function to withDefaults and the existing Record.Builder.union to something else.

Closes https://github.com/purescript/purescript-record/issues/55.