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

From Discord: Modification of ReadonlyArray.groupBy Signature #2180

Closed
effect-bot opened this issue Feb 19, 2024 · 0 comments · Fixed by #2195
Closed

From Discord: Modification of ReadonlyArray.groupBy Signature #2180

effect-bot opened this issue Feb 19, 2024 · 0 comments · Fixed by #2195

Comments

@effect-bot
Copy link

Summary

In the above conversation, there was a suggestion to modify the signature of the ReadonlyArray.groupBy function in the Effect-TS ecosystem. The initial suggestion was to change the type parameter from string to a more generic K extends string. This would allow for more flexibility in the keys used for grouping.

Later, there was a suggestion to further refine the type parameter to K extends string | symbol, which would also allow for grouping by symbols.

Additionally, it was mentioned that there is an upcoming release of Effect-TS that includes a new utility type called ReadonlyRecord.NonLiteralKey<K>, which can be used to ensure that the keys used for grouping are not literal types.

The key takeaways from this conversation are:

  1. There is a suggestion to modify the signature of ReadonlyArray.groupBy to allow for more flexible key types.
  2. The suggestion includes using a generic type parameter K extends string | symbol to allow for grouping by both string and symbol keys.
  3. There is an upcoming release of Effect-TS that includes a new utility type ReadonlyRecord.NonLiteralKey<K>, which can be used to ensure non-literal key types are used for grouping.

Discord thread

https://discord.com/channels/795981131316985866/1209088003226599434

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

Successfully merging a pull request may close this issue.

1 participant