-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Labels
Description
It would be nice to have a variant of span and a variant of takeWhile that do not just apply a predicate, but also fold over a value.
The practical application I have in mind is to span or takeWhile but only up to a maximum number of characters. This of course could be implemented if there was a spanMax and takeWhileMax but a generalized spanWith and takeWhileWith that also do a fold (in this case over the number of characters already selected by the predicate) seems to be the better choice to me.