jycabello / defuncto Goto Github PK
View Code? Open in Web Editor NEWFunctional library for C#, aiming to keep the minimum data types for ease of maintenance
Home Page: https://www.nuget.org/packages/DeFuncto.Core/
License: MIT License
Functional library for C#, aiming to keep the minimum data types for ease of maintenance
Home Page: https://www.nuget.org/packages/DeFuncto.Core/
License: MIT License
Exempli gratia:
int number = 6;
Option<int> even = number.Where(n => n % 2 == 0);
Quite dangerous, since they are effectful, not typed as such.
Add:
Select
extensions for Task<[collectionType]>
Flatten
extensions for Task<[collection[collection]]>
The function AsyncResult.Result()
is confusing with function Task.Result
Make a .MatchWith extension that takes tuples with: one predicate returning option T and one function processing T, as a last parameter, one function taking the original type (default).
The first matching predicate will apply its paired function, if no predicate matches, it will run the default function.
So you can:
collection.FirstOrNone(elm => elm.IsSomething);
Figure out how to avoid value types to be Some
in the default cases (like an int
being 0
)
Example:
- name: Package
run: dotnet pack -c Release -o . GrpcBrowser/GrpcBrowser.csproj
- name: Publish
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
public static Task<List> ToList(this Task<T[]> self) =>
self.Map(t => t.ToList());
Once this issue is solved, add it to the docs.
Try Catch with a Result<T, Exception> as return value
Update version of the Core to
0.2.3
It was returning the original entity out of convenience, but in truth is a terrible practice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.