{"provider_url":"https://hatena.blog","version":"1.0","blog_url":"https://inamori.hateblo.jp/","width":"100%","provider_name":"Hatena Blog","author_name":"inamori","title":"reduce","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20100824%2Fp1\" title=\"reduce - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"sum\u3092\u4f5c\u308a\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u524d\u306bPython\u3067reduce\u3068\u8a00\u3063\u305f\u308a\u3001Haskell\u3067fold\u3068\u8a00\u3063\u305f\u308a\u3059\u308b\u3082\u306e\u3092\u4f5c\u308a\u307e\u3059\u3002\u30ea\u30b9\u30c8\u306a\u3069\u306b\u95a2\u6570\u3092\u6b21\u3005\u306b\u9069\u7528\u3057\u3066\u30b9\u30ab\u30e9\u30fc\u5024\u306b\u3059\u308b\u3082\u306e\u3067\u3059\u3002(1, 2, 3)\u306bf(x, y) = 10x + y\u3092\u9069\u7528\u3057\u3066\u3044\u304f\u3068\u3001\u521d\u671f\u5024\u30920\u3068\u3057\u3066\u3001 10 * 0 + 1 -> 1 10 * 1 + 2 -> 12 10 * 12 + 3 -> 123 \u306810\u9032\u6570\u306b\u306a\u308a\u307e\u3059\u3002 reduce\u306f\u95a2\u6570\u306a\u306e\u3067\u7c21\u5358\u306b\u66f8\u3051\u307e\u3059\u3002\u521d\u671f\u5024\u306f\u5fc5\u9808\u3068\u3057\u307e\u3057\u305f\u3002 template<typename T, typename U, typename V> T reduce(U f, shared\u2026","type":"rich","published":"2010-08-24 00:00:00","categories":["C++"],"url":"https://inamori.hateblo.jp/entry/20100824/p1","blog_title":"inamori\u2019s diary","author_url":"https://blog.hatena.ne.jp/inamori/","image_url":null,"height":"190"}