Add shared Kyo companion operations#1647
Open
hearnadam wants to merge 2 commits into
Open
Conversation
Collaborator
|
why provide it in all effects? |
Collaborator
Author
It's just lift and unit for all effects. |
Collaborator
|
I don't see a good motive to add those methods to all effects. We typically prefer canonical APIs and avoid duplication. I think this can be an exception given the discoverability issue but we should limit the duplication. An idea: // this can be in kyo.internal but public
class KyoOps[S] private[kyo]():
def lift[A](v: A): A < S = ...
def collectAll(v: Chunk[A < S]): Chunk[A] < S
// rename the Kyo companion to Pure in kyo-kernel
object Pure extends KyoOps[Any]
object Sync extends KyoOps[Sync]The use would be more intuitive:
|
e0400d2 to
b7c3016
Compare
b7c3016 to
fa37019
Compare
fwbrasil
reviewed
May 28, 2026
| opaque type Async <: (Sync & Async.Join) = Async.Join & Sync | ||
|
|
||
| object Async extends AsyncPlatformSpecific: | ||
| object Async extends KyoOps[Sync], AsyncPlatformSpecific: |
Collaborator
There was a problem hiding this comment.
I think we don't need it here. Async has separate collection APIs with similar naming
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.
Problem
Kyo collection/pure operations from the
Kyoobject are not available on the companion objects of all effects.Solution
Add abstract class to support sharing these methods throughout other effects.