{"version":"1.0","blog_title":"A Memorandum","author_url":"https://blog.hatena.ne.jp/Naotsugu/","url":"https://blog1.mammb.com/entry/20100523/1274636814","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog1.mammb.com%2Fentry%2F20100523%2F1274636814\" title=\"foldLeft \u3068 foldRight \u306e\u30a8\u30a4\u30ea\u30a2\u30b9 - A Memorandum\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"foldLeft \u3068 foldRight \u306e\u30a8\u30a4\u30ea\u30a2\u30b9","categories":["Scala"],"provider_url":"https://hatena.blog","provider_name":"Hatena Blog","blog_url":"https://blog1.mammb.com/","height":"190","image_url":null,"published":"2010-05-23 02:46:54","description":"foldLeft \u521d\u671f\u5024\u30921\u3068\u3057\u3066\u3001arr\u306e\u548c\u3092\u5f97\u308b\u3002 val arr = List(2, 3, 4) arr.foldLeft(1){(x, y) => x + y} 1 + 2 + 3 + 4 \u3067 10 \u3068\u306a\u308b\u3002\u77ed\u304f\u66f8\u304f\u3068\u3001 arr.foldLeft(1)( _ + _ ) foldLeft \u306b\u306f /: \u3068\u3044\u3046\u30a8\u30a4\u30ea\u30a2\u30b9\u304c\u3042\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3051\u308b\u3002 (1 /: arr){_ + _} foldRight foldRight \u3067\u306f\u9069\u7528\u306e\u9806\u756a\u304c\u9006\u306b\u306a\u308b\u3002 val arr = List(2, 3, 4) arr.foldRight(1)( _ + _ ) 4+1 3+(4+1) 2+(3+(4+\u2026","width":"100%","type":"rich","author_name":"Naotsugu"}