Skip to content

Instantly share code, notes, and snippets.

@majk-p
Last active April 23, 2023 20:26
Show Gist options
  • Save majk-p/0aafb60db8c99cff4686d5d7e6304c4c to your computer and use it in GitHub Desktop.
Save majk-p/0aafb60db8c99cff4686d5d7e6304c4c to your computer and use it in GitHub Desktop.
Scala-cli script to demostrate Show typeclass derivation with kittens
//> 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