zio-config icon indicating copy to clipboard operation
zio-config copied to clipboard

Support for opaque types

Open andreoss opened this issue 10 months ago • 0 comments

Can DeriveConfig work with opaque types?

opaque type Template = String

object Template:
  import zio.*
  import zio.config.magnolia.*

  private def compile(v: String): Template = ???
  def apply(v: String): Template           = compile(v)

  given DeriveConfig[Template] = DeriveConfig[String].map(Template(_)) // Infinite loop here


andreoss avatar Apr 11 '24 23:04 andreoss