arainko / ducktape

Automatic and customizable compile time transformations between similar case classes and sealed traits/enums, essentially a thing that glues your code. Scala 3 only. Or is it duct 🤔
https://arainko.github.io/ducktape/
Other
405 stars 7 forks source link

Support tuple to product (and back) transformations #154

Closed arainko closed 3 months ago

arainko commented 7 months ago

Usage examples:

case class Numbers(int1: Int, int2: Int, int3: Int)
val toTuple = (???: Numbers).to[(Int, Int, Int)]
val fromTuple = (1, 2. 3).to[Numbers]
case class NumbersWithLessFields(int1: Int, int2: Int)
(1, 2, 3, 4, 5, 6).to[NumbersWithLessFields] // should equal NumbersWithLessFields(1, 2)