畳み込み処理
Haskell
code:memo.hs
-- foldl :: (a -> b -> a) -> a -> b -> a --> 2.0
-- foldr :: (a -> b -> b) -> b -> a -> b --> 15
Ruby
code:memo.rb
4, 2, 4.inject(64) { |result, x| result / i } (1..4).inject(0) { |sum, i| sum + i }
JavaScript
code:memo.js
確認用
Q. 畳み込み処理
参考
関連