-
Notifications
You must be signed in to change notification settings - Fork 138
Add Error Polymorphism to High-Order Functions in array
Modules
#2222
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
Add Error Polymorphism to High-Order Functions in array
Modules
#2222
Conversation
Incorrect early return type in Array::makei implementationCategory if length <= 0 {
return ok([])
} else { Reasoning Missing error propagation in View::map loop implementationCategory if self.length() == 0 {
return ok([])
} Reasoning Inconsistent documentation examples with new error handlingCategory /// ```
/// try {
/// [1, 2, 3, 4, 5].each(fn(x){ arr.push(x) })
/// assert_eq(arr, [1, 2, 3, 4, 5])
/// }
/// ```
**Reasoning**
The documentation examples don't reflect the new error handling capabilities of these functions. Examples should demonstrate proper error handling to guide developers in correct usage.
</details> |
Pull Request Test Coverage Report for Build 7193Details
💛 - Coveralls |
76a4e44
to
6278816
Compare
pub fn[T] FixedArray::each( | ||
self : FixedArray[T], | ||
f : (T) -> Unit?Error | ||
) -> Unit?Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one uses intrinsics, so it can't be modified like this directly. @Yu-zh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove my changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will remove the intrinsic for now.
can you do a rebase? there is a rebase conflict |
There are too many problems that rebase needs to solve. Maybe creating a new branch would be better🥲 |
You need to improve your github workflow. |
eb5c125
to
c45b350
Compare
Thank you for your reminder! Actually, I have already realized this problem and won't make the same mistake again next time |
Summary
This PR supplements the higher-order functions that were omitted in #2211
Details
Affected Functions
Array
makei
FixedArray
each
makei
rev_each
View
map
mapi
These updates ensure a more robust and consistent approach to error handling across the array-related modules.