// summary : chimney simplest usage example // keywords : scala, chimney, @testable // publish : gist // authors : chimney // license : Apache2 // id : d518a36f-c696-46b2-b777-14af2a19a562 // created-on : 2023-06-23T16:20:02+02:00 // managed-by : https://github.com/dacr/code-examples-manager // run-with : scala-cli $file //> using scala "3.5.1" //> using dep "io.scalaland::chimney:1.5.0" //> using dep com.lihaoyi::pprint::0.9.0 import io.scalaland.chimney.dsl.* import pprint.* case class Foo(x: String, y: Int, z: Boolean = true) case class Bar(x: String, y: Int) pprintln(Foo("abc", 10).transformInto[Bar]) pprintln(Bar("abc", 10).into[Foo].enableDefaultValues.transform)