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

Add support Scala 3 for module derivation #1275

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Roman-Statsura
Copy link
Contributor

@Roman-Statsura Roman-Statsura commented May 8, 2024

Add support Scala 3 for module derivation

But i couldn't migrate to Scala 3

  1. class InitDerivation
  2. And this:
Code
import derevo.{DerivationK2, DerivationKN11}
import tofu.higherKind.bi.{EmbedBK, RepresentableB}
import tofu.higherKind.{Embed, RepresentableK}

object representableK extends DerivationK2[RepresentableK] {
  def instance[T[_[_]]]: RepresentableK[T] = macro HigherKindedMacros.representableK[T]
}

object embed extends DerivationK2[Embed] {
  def instance[T[_[_]]]: Embed[T] = macro HigherKindedMacros.embed[T]
}

object representableB extends DerivationKN11[RepresentableB] {
  def instance[T[bf[_, _]]]: RepresentableB[T] = macro HigherKindedMacros.representableB[T]
}

object biembed extends DerivationKN11[EmbedBK] {
  def instance[T[fb[_, _]]]: EmbedBK[T] = macro HigherKindedMacros.embedB[T]
}

If you could tell me how this could be done, I would be grateful

@dos65
Copy link
Collaborator

dos65 commented May 14, 2024

@Roman-Statsura Currently, there is no scala3 impl for HigherKindedMacros . In migrated modules we just do not migrate such parts on scala3.

It's hard tro say if this mofdule makes but it feel like this module doesn't make a lot of sence without this macro. So we need to wait for implementation of HigherKindedMacros

What about class InitDerivation - you can take a look at modules/logging/derivation/src/main/scala-2/tofu/logging/derivation/LoggingDerivationImpl.scala and modules/logging/derivation/src/main/scala-3/tofu/logging/derivation/LoggingDerivationImpl.scala

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.

None yet

2 participants