Comments (5)
@jreina would it be acceptable to add other extension methods for IEnumerable<T>
to the repo?
Thanks!
from shittylinq.
@Programm3r
Absolutely! Just opened #4 specifically for this.
from shittylinq.
@jreina many thanks!
from shittylinq.
Hope that this helps :)
One sidenote: I opted to go for the parameterless constructor constraint, since just using default will result in null for objects/classes.
Using the constructor constraint solves this and it also works for structs and types.
I am really bad at unit testing so I was hoping someone else has idea's for good cases.
from shittylinq.
@tosti007 thanks for your PR!
Looking at these specifications for the Aggregate function, it looks like the signature for this overload should be different and the behavior is slightly different as well.
Instead of constructing a new instance of T
and creating a constraint on what types can be used here, the function should instead use the first element in the sequence as the seed value and throw an InvalidOperationException
if the sequence is empty. That allows us to get rid of the U
type parameter altogether.
Regarding unit tests, I think the tests should ensure this new function throws an InvalidOperationException
when the sequence is empty, and make sure the first item in the sequence is used as the seed.
from shittylinq.
Related Issues (20)
- Create a completeness breakdown chart with benchmarks
- Add OrderByDescending method and tests HOT 1
- Add Prepend method and tests HOT 1
- Add Repeat method and tests
- Add Reverse method and tests
- Add SequenceEqual method and tests HOT 1
- Add Single method and tests HOT 2
- Add SingleOrDefault method and tests HOT 4
- Add SkipLast method and tests HOT 1
- Add SkipWhile method and tests HOT 1
- Add Sum method and tests HOT 4
- Add TakeLast method and tests HOT 1
- Add TakeWhile method and tests HOT 3
- Add ThenBy method and tests HOT 2
- Add ThenByDescending method and tests HOT 2
- Add ToArray method and tests HOT 2
- Add ToDictionary method and tests HOT 2
- Add ToHashSet method and tests
- Add ToLookup method and tests HOT 1
- Add Union method and tests HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shittylinq.