Skip to content

1.0.0-M6

Compare
Choose a tag to compare
@neko-kai neko-kai released this 01 Sep 15:56
· 499 commits to develop since this release
  • Update to Dotty 0.26.0
  • Fix #32 resolve parameters in structural types (#66)
    This allows polymorphic usage of Tags with structural types, e.g. the following will now work correctly:
    trait Typeclass[A] { 
      type Out
    }
    
    def tagFor[A: Tag, B: Tag] = 
      Tag[Typeclass[A] { type Out = B }]
    
    tagFor[Int, String].tag == Tag[Typeclass[Int] { type Out = String }].tag // true
    // `A` & `B` type parameters were substituted for Int & String in `tagFor`
    This also allows Tags for higher-kinded TagK's, which are encoded using structural types, to be resolved correctly and allows polymorphic injection of TagK's in distage modules:
    def moduleWithTag[F[_]: TagK] = new ModuleDef {
      addImplicit[TagK[F]]
      make[Unit].fromHas(
        (tag: TagK[F]) =>
          // (tag: TagK[F]) parameter no longer causes an error 
          zio.console.putStrLn(s"Got TagK[F]=$tag")
      )
    }