Last active
April 23, 2023 20:26
-
-
Save majk-p/0aafb60db8c99cff4686d5d7e6304c4c to your computer and use it in GitHub Desktop.
Scala-cli script to demostrate Show typeclass derivation with kittens
This file contains 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
//> using dep "org.typelevel::kittens:3.0.0" | |
//> using dep "org.typelevel::cats-core:2.9.0" | |
import cats.Show | |
import cats.implicits.given | |
import cats.derived.* | |
case class Person(name: String, surname: String, age: Int) | |
given Show[Person] = semiauto.show | |
val testPerson = Person("Test", "Person", 100) | |
@main | |
def printPerson() = | |
println(testPerson.show) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment