Quick Start
Chimney is supported for Scala 2.12, 2.13, 3.3+ on JVM, Scala.js and Scala Native with full feature parity between each version.
The newest versions on each platform are:
with Scaladoc API documentation available:
To start using the library add to your sbt config:
// if you use Scala on JVM-only
libraryDependencies += "io.scalaland" %% "chimney" % "0.8.1"
// if you cross-compile to Scala.js and/or Scala Native
libraryDependencies += "io.scalaland" %%% "chimney" % "0.8.1"
and then import in your codebase:
or try it in Scala CLI:
# Scala 2.12
scala-cli repl --scala "2.12.18" --dependency "io.scalaland::chimney::0.8.1"
# Scala 2.13
scala-cli repl --scala "2.13.12" --dependency "io.scalaland::chimney::0.8.1"
# Scala 3
scala-cli repl --scala "3.3.1" --dependency "io.scalaland::chimney::0.8.1"
Tip
If you are a advanced user, who wants to learn the difference between automatic derivation and semiautomatic derivation in Chimney, see Automatic, semiautomatic and inlined derivation.
Java collections integration
If you are interested in using java.util.Optional
, java.util.Collection
s, java.util.Map
s, java.util.streams
and
other Java's types, you need to add integration to your project:
// Java collections integrations is released only on JVM Scala!
libraryDependencies += "io.scalaland" %% "chimney-java-collections" % "0.8.1"
and then import:
Tip
See Java collections integration cookbook for more information.
Cats integration
If you are interested in Cats integrations for Partial Transformers, you need to add to your project:
// if you use Scala on JVM-only
libraryDependencies += "io.scalaland" %% "chimney-cats" % "0.8.1"
// if you cross-compile to Scala.js and/or Scala Native
libraryDependencies += "io.scalaland" %%% "chimney-cats" % "0.8.1"
Tip
See Cats integration cookbook for more information.
Protocol Buffers integration
If you want to improve support for types defined in ScalaPB, you need to add to your project:
// if you use Scala on JVM-only
libraryDependencies += "io.scalaland" %% "chimney-protobufs" % "0.8.1"
// if you cross-compile to Scala.js and/or Scala Native
libraryDependencies += "io.scalaland" %%% "chimney-protobufs" % "0.8.1"
Tip
See Protocol Buffers integration cookbook for more information.