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

Expose SealedTrait.Subtype constructor fields #329

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

jatcwang
Copy link
Contributor

In some usecases, the typeclass instance of a subtype can be modified, so it is useful to allow library authors to recreate the Subtype.

This is the case for difflicious since you can be given a Differ[ComplexType] and be able to "tweak" the individual Differs that made up the Differ[ComplexType] instance. In the Scala 2 implementation, You can see me recreating Subtype after transforming the subtype's Differ

@adamw
Copy link
Member

adamw commented Jul 20, 2021

Wouldn't the public interface become confusing once we expose all of these members? Maybe just exposing index would be sufficient, as that's the only piece of information not available through other means?

In some usecases, the typeclass instance of a subtype can be modified, so it is useful to allow library authors to recreate the Subtype.
@jatcwang
Copy link
Contributor Author

jatcwang commented Jul 20, 2021

You're right. Updated :)

@adamw adamw merged commit 879401e into softwaremill:scala3 Jul 21, 2021
@adamw
Copy link
Member

adamw commented Jul 21, 2021

Thanks :)

@jatcwang jatcwang deleted the patch-1 branch July 21, 2021 14:33
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 this pull request may close these issues.

3 participants