The problem with the Stream approach is you lose the original item. If you want the max length then its fine. If you want the longest string then you are sort of stuck.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/49ad9d2d-9f4f-4f0c-a229-7a6357a03c3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I misunderstood the original post. I thought it was a request for a more universal *_by api (beyond min_by and max_by). My (possibly unrelated) point was that you can't easily mimic max_by without a custom reduce.
Re: the original proposal, we already have uniq, all?, and any? that have the optional second argument. I wouldn't be opposed to making that standard.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/9987b54c-4f51-401e-b8f2-02f5b353e1dc%40googlegroups.com.