Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active December 15, 2025 17:29
Show Gist options
  • Select an option

  • Save dacr/01df233da9014dd45e7af15ceac83ce8 to your computer and use it in GitHub Desktop.

Select an option

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
// 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