zio-config
zio-config copied to clipboard
scala3 auto derivation module (than Magnolia and shapeless).
Probably this would involve a generic module in Scala3, with its own Generic
that allows to and fro from tuples.
The intermediate tuple elements can stay as type members, allowing us to use Conversion[Product].to(product)
to do a few computations. Incase, we end up needing to propagate the type info of B, use an Aux
pattern can be repeated here type Aux[A, X] = Conversion { type B = X }
.
This implies the magnolia specific module will look-like-shapeless but through zero dependency (for scala3)
trait Conversion[A] {
type Out
def to(a: A): Out
def from(b: Out): A
}
Id like a shot at tackling this if you don't mind :) I've been dying for zio-config in scala 3!
@danielbe1 Sorry for the late response. Unfortunately, I have already been working on this issue, and I apologise I didn't mention it in the list of assignees.
@danielbe1 Thanks a ton for offering the help. I have been looking for someone up until 1 week before, however, I started straight away once I got some bandwidth.
For those who would like to know the progress, here is it: https://github.com/afsalthaj/zio-config-scala3-auto-derivation
ETA: Mid July, however we will try our best to smash this even before.
There will not be DeriveConfigDescriptor
and inheritance pattern of custom derivations.
Any custom behaviour related to names and nesting will be part of the annotations:
https://github.com/afsalthaj/zio-config-scala3-auto-derivation/blob/master/src/main/scala/zio/config/magnolia/Macros.scala
Draft PR that implements almost all functionalities is here: https://github.com/zio/zio-config/pull/574