We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As a developer, I want to use this library to generate monads, so that I don't have to write them manually.
I should be able to do something like this:
[Union] public partial record Option<T> { partial record Some(T Value); partial record None(); } var option = new Option<string>.Some("foo"); var value = option.Match( some => some.Value, none => "" ); Console.WriteLine(value); // "foo"
[Union] public partial record Result<TFailure, TSuccess> { partial record Success(TSuccess Value); partial record Failure(TFailure Error); } var result = new Result<Exception, string>.Failure(new Exception("Boom!")); var message = result.Match( success => success.Value, failure => failure.Error.Message ); Console.WriteLine(message); // "Boom!"
The text was updated successfully, but these errors were encountered:
Closed by #24 and #25
Sorry, something went wrong.
No branches or pull requests
As a developer, I want to use this library to generate monads, so that I don't have to write them manually.
I should be able to do something like this:
The text was updated successfully, but these errors were encountered: