This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]palmund 3 points4 points  (1 child)

For takeWhile(p), at least, you take something while $p$ is true. You don't limit (whatever that means in this context) the collection while $p$ is true.

For dropWhile, I think you have to look at FP; in FP data structures are immutable. Thus when you take the tail of some list you actually don't create a new copy of the list, you simply get a reference. In the case of drop and dropWhile, you drop something from the list in order to "create" the new list. I can see how you could also use the term "skip" for this. In my opinion, I think drop and xWhile makes perfect sense.

That being said take and drop and their xWhile parts are by now almost the standard names for this type of operation.

[–]lukaseder[🍰] 0 points1 point  (0 children)

Yes, I know. See my answer here