You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
traitTypeclass[A] {
typeOut
}
deftagFor[A:Tag, B:Tag] =Tag[Typeclass[A] { typeOut=B }]
tagFor[Int, String].tag ==Tag[Typeclass[Int] { typeOut=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:
defmoduleWithTag[F[_]:TagK] =newModuleDef {
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")
)
}