> On Nov 7, 2017, at 4:23 PM, John McCall via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> https://github.com/apple/swift-evolution/blob/master/proposals/0187-introduce-filtermap.md
>  
> <https://github.com/apple/swift-evolution/blob/master/proposals/0187-introduce-filtermap.md>
> 
>       • What is your evaluation of the proposal?

-0. I think it would be more useful first to have an attribute that either 
warns or prevents optional promotion, so that misuse becomes a warning or 
error. If it remains a problem for readability, we can consider a rename.

However, I don’t like filterMap as a name, because unlike flatMap which is a 
combination of two things, filterMap is a combination of three - map, filter, 
and a hard-coded filter that rejects nil.

This seems just as likely to create odd misuse for people who know they want to 
map and filter, but who would be better served and have arguably cleaner code 
by having a lazy sequence rather than using mapFilter, e.g. (ignoring gender 
data often being an anti-pattern) a conversion from an array people to an array 
femaleFirstNames.

>       • Is the problem being addressed significant enough to warrant a change 
> to Swift?
I think so, I’m just conflicted on whether this is the right solution.

>       • Does this proposal fit well with the feel and direction of Swift?
Yes

>       • If you have used other languages or libraries with a similar feature, 
> how do you feel that this proposal compares to those?
>       • How much effort did you put into your review? A glance, a quick 
> reading, or an in-depth study?

In-depth study

-DW

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to