{"width":"100%","image_url":null,"blog_title":"\u96d1\u8a18","categories":["Scala"],"author_url":"https://blog.hatena.ne.jp/namaza/","url":"https://ytrewq.hatenablog.com/entry/2017/09/26/205630","published":"2017-09-26 20:56:30","height":"190","title":"(implicit s: Show[A])","provider_url":"https://hatena.blog","type":"rich","provider_name":"Hatena Blog","description":"def log[A](a: A)(implicit s: Show[A]) = println(s.show(a)) \u3053\u306e(implicit s: Show[A])\u306f\u30ab\u30ea\u30fc\u5316\u3068implicit\u3092\u4e21\u65b9\u4f7f\u3063\u305f\u7d50\u679c\u3002 \u3082\u3057log[Int](3)\u3068\u3059\u308b\u3068\u3001\u5f15\u6570s\u304c\u6e21\u3055\u308c\u3066\u3044\u306a\u3044\u3001\u304b\u3064implicit\u306a\u306e\u3067\u3001Int\u304c\u5f15\u6570\u3067\u3001\u304b\u3064implict\u306aShow\u30e1\u30bd\u30c3\u30c9\u3092\u63a2\u3059\u3002 implicit val intShow = new Show[Int] { def show(i:Int) = i} \u3053\u3093\u306a\u306e\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u3001\u305d\u308c\u3092\u5148\u7a0b\u306es\u306b\u5f53\u3066\u306f\u3081\u308b\u3002 Scala\u306e\u578b\u30af\u30e9\u30b9\uff08typeclass\uff09\u306e\u5206\u304b\u308a\u3084\u3059\u3044\u8aac\u660e(C\u2026","version":"1.0","blog_url":"https://ytrewq.hatenablog.com/","author_name":"namaza","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fytrewq.hatenablog.com%2Fentry%2F2017%2F09%2F26%2F205630\" title=\"(implicit s: Show[A]) - \u96d1\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}