1 Haskell 2012.4.17 2 Haskell 4 Mew Firemacs Mighttpd 3 4 5 6 7 8 9 10 10, 20, 30, 40, 50 0 n n 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50 *4 = 400 11 Ruby inject def func (ar) sum = 0; i = 0; ar.each{|x| sum += x * i; i += 1; } sum; end func([10,20,30,40,50]); 400 12 Haskell map & reduce zip [0..] [10,20,30,40,50] [(0,10),(1,20),(2,30),(3,40),(4,50)] map (\(i,x) -> x*i) ( ) [0,20,60,120,200] foldl (+