{"published":"2015-11-20 15:25:13","provider_name":"Hatena Blog","author_name":"shigemk2","author_url":"https://blog.hatena.ne.jp/shigemk2/","image_url":null,"type":"rich","url":"https://www.shigemk2.com/entry/collectfirst_scala","title":"collectFirst","blog_url":"https://www.shigemk2.com/","provider_url":"https://hatena.blog","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.shigemk2.com%2Fentry%2Fcollectfirst_scala\" title=\"collectFirst - by shigemk2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["Scala"],"height":"190","description":"case\u306b\u30de\u30c3\u30c1\u3057\u305f\u6700\u521d\u306e\u5024\u3092\u8fd4\u3059\u3001\u3068\u3044\u3046\u3082\u306e\u3002 scala> List(1,2,3).collectFirst{ case 2 => \"two\" } res1: Option[String] = Some(two) scala> List(1,2,3).collectFirst{ case 4 => \"four\" } res2: Option[String] = None Scala\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30e1\u30bd\u30c3\u30c9\u30e1\u30e2(Hishidama's Scala collection method Memo) \u5b9f\u88c5\u3092\u898b\u305f\u3089\u3001\u3053\u3093\u306a\u611f\u3058\u3002PartialFunction\u3092\u4f7f\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3002\u524d\u534a\u3067\u30ea\u30b9\u30c8\u3092\u3054\u306b\u3087\u3054\u306b\u3087\u2026","width":"100%","blog_title":"by shigemk2"}