News for hackers. Stuff that matters.
Re:Why I Prefer Functional Programming by jolmg on Thursday September 19, 2019 @08:28PM (#21022144)
> reduce() on the other hand is always illegible to me.

I used it recently in ruby to write an sql query using Rails' ORM and it seemed quite nice to me. Something like:

  foos.to_enum.with_index.reduce(initial_query) do |query, (foo, i)|
    query.joins(...).where(...)
  end

There are no comments on this comment yet.