-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Do notation #43
Do notation #43
Conversation
hi @taman9333 I like the idea. Can you explain why you named it "Do" instead of "Try" or other? |
|
Yes, I made a fix, while merging another contrib recently. Thanks for your work |
Description
This PR introduces do-notation to simplify error handling and improve the readability of monadic operations.
Example:
Benefits:
Without the do-notation the code becomes much more verbose and less maintainable due to the explicit error handling after each step. By using do-notation, we centralize the error handling logic, resulting in cleaner and more concise code.
Comparison of createService Function:
without do-notation
With do-notation