Created
April 11, 2020 07:29
-
-
Save polyglotpiglet/089d7a808cdd038c5acd31d2bcb6b9c1 to your computer and use it in GitHub Desktop.
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
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