‹ BackHN Continuity

Thread

Anecdotally, programmers dislike "reduce"

175 points · 283 comments · vinhnx

  1. FacelessJim · · focus · HN ↗
    Have they heard of our lord and saviour “mapreduce”?

    x = mapreduce(f, r, arr, init)

    equivalent to

    x=init

    for e in arr

      r(x, f(e))
    
    end

    Of course, if r is ever something different than a simple operator, slap yourself. But otherwise it’s an absurdly powerful construct.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.