2chevskii / result Goto Github PK
View Code? Open in Web Editor NEWResult type for C#
License: MIT License
Result type for C#
License: MIT License
Users (me, in particular) do not like to write too much of <,,,,>
stuff,
so we need to be able to allow automatic type conversion between results with different type arguments when they do not affect it's state (see usage examples)
Result<int, ExampleException> DoStuff() {
if(allOk) {
return Result.Ok(42); // Result.Ok here returns Result<int, Exception>, so we convert it to Result<int, ExampleException>
}
return Result.Err(new ExampleException()); // Result.Err here returns Result<object, ExampleException>, so we convert it to Result<int, ExampleException>
}
Since in C# we are not allowed to make generic type casting operators, or in any other
way cast from base classes and interfaces, we probably need some intermediate type like ConvertibleResult<T>
which will only hold it's state and current value, without carrying
information about another possible value type
No response
Yup
We need to provide less-nested way to map results which are part of an async flow.
For example: Task<Result<T,E>>
should be mappable on the top level (without await
or ContinueWith
usage)
Maybe we should also provide methods for the invert situation (when Result's T
or E
are Tasks/ValueTasks)
No response
No response
Yup
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.