Last active
December 15, 2025 17:29
-
-
Save dacr/01df233da9014dd45e7af15ceac83ce8 to your computer and use it in GitHub Desktop.
chimney simplest usage example / published by https://github.com/dacr/code-examples-manager #d518a36f-c696-46b2-b777-14af2a19a562/43f866d2204d2a588d84ca5041436607f9c3be62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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.7.1" | |
| //> using dep "io.scalaland::chimney:1.8.2" | |
| //> 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment