Closed taman9333 closed 3 months ago
@samber
hi @taman9333
I like the idea.
Can you explain why you named it "Do" instead of "Try" or other? Do
does not seem meaningful to me. But I might be wrong.
@samber I am just following the same naming convention introduced in Haskell Do you prefer a different name?
~~@samber I've fixed those Testable Examples. Let me know if you have any other comments. You can merge the PR if you don't have any concerns~~ I have reverted fixing Testable Examples as I have found you fixed that
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