DoubleSharp provides convenience features for:
- LINQ:
ToDictionary
convertingIEnumerable
s of tuples intoDictionary
s automatically;Shuffle
andShuffled
providing in-place and copy shuffles;Flatten
reducing the nesting ofIEnumerable
s; and much more - Concurrency:
Locked
extension method on objects allowing locking as an expression;Increment
/Decrement
/Add
providing inline atomic operations - Functional:
Compose
allowing function composition - Progress:
WithProgress
andWithTimedProgress
extension methods onIEnumerable
/ICollection
providing parallel-friendly progress bars - Random:
Rng
providing a static class with automatic per-CPU seeds - Pretty:
ToPrettyString
extension method for all objects to convert it to a human-readable form;Print
andPrettyPrint
extension methods (aliases) to print that to the console, akin to Python'spprint
module
Our general goal is to make C# even easier to use than it is right now. If it's something we have to write in several projects, it should be here instead.
Simply reference the DoubleSharp
package on NuGet and then import the namespaces with the functionality you need.
Check out the progress bar example or the unit tests for use cases!