-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
use Maybe type for error handling (Fail case) #303
Comments
Another thing to consider is how to add rich error processing. i.e. instead of just pass down and up the error, we can process it. e.g. type Add<A, B> = DoWork<A, B> extends infer Result
? Result extends FailBrand<unknown>
? `Cannot add '${A}` and `${B}` due to ${Result.message}`
: Result
: never The idea is to use branding for fail case when do a brand check to see if the result is an error. |
This is partially addressed by the new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of:
Accept
Maybe<NumericStruct>
and propagate the error.This will simplify many implementation.
The text was updated successfully, but these errors were encountered: