git » homepage.git » master » tree

[master] / archive / forums / hacker-news / raw / items / 703148.json

{"by":"wooby","id":703148,"kids":[703275],"parent":702952,"text":"How much they've made so far, with scala:<p><pre><code>  scala&#62; def income(n_users:Int) = (1 to n_users) map(i =&#62; (i-1)*.001) reduceLeft(_+_)\n income: (Int)Double\n\n  scala&#62; income(2901)\n res0: Double = 4206.45</code></pre>","time":1247549000,"type":"comment"}