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

Derivation object composition #333

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Derivation object composition #333

merged 1 commit into from
Nov 19, 2021

Conversation

zawodskoj
Copy link
Collaborator

This PR allows to define composed derivation objects using this syntax

trait Part1[T]
trait Part2[T]

object p1 extends Derivation[Part1] {
  def instance[T]: Part1[T] = new Part1[T] {}
}

object p2 extends Derivation[Part2] {
  def instance[T]: Part2[T] = new Part2[T] {}
}

@composite(p1, p2)
object p1AndP2 extends CompositeDerivation

@derive(p1AndP2)
case class HasP1AndP2()

@zawodskoj zawodskoj requested a review from Odomontois November 18, 2021 20:45
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.

2 participants