Skip to content

Instantly share code, notes, and snippets.

@paulp
Created August 9, 2014 18:59
Show Gist options
  • Save paulp/775717c91d19506e340a to your computer and use it in GitHub Desktop.
Save paulp/775717c91d19506e340a to your computer and use it in GitHub Desktop.
scala> class Bippy
defined class Bippy
scala> val x = new Bippy
x: Bippy = Bippy@4919b727
scala> show"$x"
<console>:15: error: type mismatch;
found : Bippy
required: psp.std.Shown[_]
show"$x"
^
scala> implicit val BippyShow = Show[Bippy](_ => "I'm Bippy!")
BippyShow: psp.std.Show[Bippy] = psp.std.Show$$anon$1@78146d52
scala> show"$x"
res1: String = I'm Bippy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment