{"id":2604,"date":"2015-09-16T01:07:24","date_gmt":"2015-09-16T01:07:24","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=2604"},"modified":"2015-09-16T01:07:24","modified_gmt":"2015-09-16T01:07:24","slug":"scala-filter-example","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/scala-filter-example\/","title":{"rendered":"Scala filter example"},"content":{"rendered":"<p>The &#8220;filter&#8221; function loops over a List, Stream, etc, and removes entries that don&#8217;t match the desired criteria:<\/p>\n<pre lang=\"scala\">\nList(1, 3, 4, None).filter(x => x.equals(3))\nres9: List[Any] = List(3)\n<\/pre>\n<p>You can also use the underscore syntax to simplify this. The following is obviously the same as the first example:<\/p>\n<pre lang=\"scala\">\nList(1, 3, 4, None).filter(_ => _.equals(3))\nres10: List[Any] = List(3)\n<\/pre>\n<p>But, it allows you to simplify to this very concise version:<\/p>\n<pre lang=\"scala\">\nList(1, 3, 4, None).filter(_.equals(3))\nres11: List[Any] = List(3)\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;filter&#8221; function loops over a List, Stream, etc, and removes entries that don&#8217;t match the desired criteria: List(1, 3, 4, None).filter(x => x.equals(3)) res9: List[Any] = List(3) You can also use the underscore syntax to simplify this. The following is obviously the same as the first example: List(1, 3, 4, None).filter(_ => _.equals(3)) res10: &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/scala-filter-example\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Scala filter example&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[480,482,488],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2604"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=2604"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2604\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=2604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=2604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=2604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}