Closed soujiro32167 closed 8 months ago
Just tested. I'll need a neotype-zio
package for the integration. But it will work. I'll open something tonight!
given [A, B](using newType: Newtype.WithType[A, B], tag: Tag[A]): Tag[B] =
newType.unsafeWrapF(tag)
This makes it work.
My hero! This is the same technique as you use to derive other typeclasses (circe, quill) isn't it?
Update: There are still some issues. It can now derive the tag; however, there are tag materialization issues in some cases due to some widening that the ZLayer macros perform. I'll try and get everything fixed. It'll work for basic things atm.
After exploring some more recently, I think this needs to be fixed @ the izumi reflect level :(
related to https://github.com/zio/zio-prelude/issues/821
Alas, Izumi tag strikes again!
to reproduce: