Repository navigation
[data] records more than 22 AsFields (#1006) - #1013
Merged
fwbrasil merged 3 commits intoJan 14, 2025
Merged
Conversation
fwbrasil
reviewed
Jan 14, 2025
| All(f.fields + a) | ||
| end All | ||
|
|
||
| given [A](using ev: FieldsLike[A], a: All[ev.T]): AsFields[A] = a.fields |
Collaborator
There was a problem hiding this comment.
This is an interesting pattern! I hadn't considered transforming the intersection to tuples first
fwbrasil
approved these changes
Jan 14, 2025
Collaborator
|
thank you @road21! |
This was referenced Jan 14, 2025
fwbrasil
added a commit
that referenced
this pull request
Jan 17, 2025
…idence (#1021) This PR generalizes the approach introduced by @road21 in #1013 and introduces `CanEqual` for `Record`. I gave a shot at providing `Render` with but couldn't make it work properly. I'm planning to try `TypeSet` to resolve the inference issues we have with `Boundary`. We currently have to use an `inline` [method indirection](https://github.com/getkyo/kyo/blob/5674fab6a54feae3d8936182c18f73082910810f/kyo-core/shared/src/main/scala/kyo/Async.scala#L76) for boundaries to infer correctly. --------- Co-authored-by: Adam Hearn <[email protected]> Co-authored-by: Aleksey Troitskiy <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I haven't found a way to avoid macro (intersection types don't play well with implicits). So I have created typeclass
FieldsLike(evidence) that splitsFieldstype into tuple of~types, and then derives instance for every tuple member.This typeclass
FieldsLikecould potentially be used for other features like removing fields by keys.