Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeclass - record - create SemigroupUnion, MonoidUnion and SemigroupIntersection #2635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FredericEspiau
Copy link

@FredericEspiau FredericEspiau commented Apr 26, 2024

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Creates SemigroupUnion, MonoidUnion and SemigroupIntersection for Record

I didn't create anything for difference as I didn't see the point
I didn't ceate a Monoid for intersection as I can't think of a logical empty element (I could do it with some kind of Proxy maybe ?)

Related

  • Related Issue #
  • Closes #

Copy link

changeset-bot bot commented Apr 26, 2024

🦋 Changeset detected

Latest commit: dab28f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@effect/typeclass Patch
@effect/printer-ansi Patch
@effect/printer Patch
@effect/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@gcanti gcanti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest adding a get prefix to align it with the current convention, for example, getSemigroupUnion.

I wonder how useful an instance for ReadonlyRecord<string | symbol, A> is. Generally, it's much more common to work with ReadonlyRecord<string, A>. Furthermore, the current implementation does not work with records with symbolic keys (Record.union only works with keys of type string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Discussion Ongoing
Development

Successfully merging this pull request may close these issues.

None yet

2 participants