Hacker News new | past | comments | ask | show | jobs | submit login

Maybe a simpler way to illustrate this is two different functions built off of filter:

`keep`: Given a predicate and a collection, filter the collection to retain only items for which predicate evaluates to true.

`discard`: Given a predicate and a collection, filter the collection to discard items for which the predicate evaluates to false.

These are two very reasonable functions that would have the exact same signature, would be appropriate for the same arguments, but have two different behaviors!




Honestly, you could reasonably call either of those "filter" :D




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: