Skip to content

Instantly share code, notes, and snippets.

@polyglotpiglet
Created April 11, 2020 07:29
Show Gist options
  • Save polyglotpiglet/089d7a808cdd038c5acd31d2bcb6b9c1 to your computer and use it in GitHub Desktop.
Save polyglotpiglet/089d7a808cdd038c5acd31d2bcb6b9c1 to your computer and use it in GitHub Desktop.
object Main extends App {
import cats._
import cats.implicits._
println(123.show)
println("xyc".show)
println(true.show)
// using show on custom objects
case class Cat(name: String)
val cat = Cat("Ruby")
implicit val catShow: Show[Cat] = Show.show[Cat](c => "Cat called " + c.name)
println(cat.show)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment