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

Support extends DepFn1[C] #30

Open
DmytroMitin opened this issue Oct 11, 2019 · 0 comments
Open

Support extends DepFn1[C] #30

DmytroMitin opened this issue Oct 11, 2019 · 0 comments
Labels
bug Something isn't working macros

Comments

@DmytroMitin
Copy link
Owner

  /*@aux*/ @instance /*@delegated*/
  trait FlattenAndDeduplicate[C <: Coproduct] extends DepFn1[C]{
    type Out <: Coproduct
//    def apply(t: C): Out
  }
  object FlattenAndDeduplicate {
    type Aux[C <: Coproduct, Out0 <: Coproduct] = FlattenAndDeduplicate[C] { type Out = Out0 }
//    def instance[C <: Coproduct, Out0 <: Coproduct](f: C => Out0): Aux[C, Out0] = new FlattenAndDeduplicate[C] {
//      override type Out = Out0
//      override def apply(t: C): Out0 = f(t)
//    }

    object identityPoly extends Poly1 {
      implicit def identityCase[A]: Case.Aux[A, A] = at(identity)
    }

    implicit def mkFlattenAndDeduplicate[C <: Coproduct, C_flatten <: Coproduct](implicit
      flatMap: FlatMap.Aux[C, identityPoly.type, C_flatten],
      dedup: Deduplicate[C_flatten],
    ): Aux[C, dedup.Out] = instance(c => dedup(flatMap(c)))
  }
Error:(53, 39) no arguments allowed for nullary method instance: ()App165.FlattenAndDeduplicate[C]{type Out = Out0$macro$1}
    ): Aux[C, dedup.Out] = instance(c => dedup(flatMap(c)))
@DmytroMitin DmytroMitin added bug Something isn't working macros labels Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macros
Projects
None yet
Development

No branches or pull requests

1 participant