You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
Very very often, it is unnecessary to take into account the index of the element when mapping. For instance:
[[foos filter:^BOOL(NSString *foo) {
return [foo length] > 0;
}] each:^(NSString *bar) {
// do something with bar
}];
This code works perfectly with well with Functional.m. However, under Overline, we must also define a NSUInteger parameter, which makes the statement less readable.
[[foos filter:^BOOL(NSString *foo, NSUInteger __unused) {
return [foo length] > 0;
}] each:^(NSString *bar, NSUInteger __unused) {
// do something with bar
}];
I think Overline should consider following the same interface as Functional.m.
In fact, the act of 'mapping' data from one array into another should never depend on its position and thus there should not be a mapWithIndex: method at all.
The text was updated successfully, but these errors were encountered:
fatuhoku
changed the title
Index-less versions of map, filter, each etc.
Index-less versions of map, filter, each etc. by default; declare eachWithIndex
Jul 7, 2014
Very very often, it is unnecessary to take into account the index of the element when mapping. For instance:
This code works perfectly with well with Functional.m. However, under Overline, we must also define a
NSUInteger
parameter, which makes the statement less readable.I think Overline should consider following the same interface as Functional.m.
In fact, the act of 'mapping' data from one array into another should never depend on its position and thus there should not be a
mapWithIndex:
method at all.The text was updated successfully, but these errors were encountered: