Athari / YaLinqo

Yet Another LINQ to Objects for PHP [Simplified BSD]
https://athari.github.io/YaLinqo
BSD 2-Clause "Simplified" License
441 stars 39 forks source link

Meta: add new methods #9

Open Athari opened 9 years ago

Athari commented 9 years ago

Ideas for new methods to add and example implementations in other libraries.

linq.js

Ix

MoreLinq

EvenMoreLinq

LinqLib

PHP

other

P.S. If you need any of these methods or have any other ideas for new features, please let me know. New features aren't high priority until someone actually needs them.

BLumia commented 3 years ago

Would like to leave a +1 for DefaultIfEmpty, which is also in .NET linq API. I think this can be very useful when need to do something like this:

from($ee)->skipWhile($invalidFunc)->average(
    function($p) { return $p['latency']; }
)

Since after skipWhile the data could be empty, calling average() may cause issue, I think DefaultIfEmpty can be useful here.