:: Map k v -> (v -> Bool) -> Map k v package:streamly
Strip all leading and trailing occurrences of an element passing a
predicate and make all other consecutive occurrences uniq.
prune p = dropWhileAround p $ uniqBy (x y -> p x && p y)
> Stream.prune isSpace (Stream.fromList " hello world! ")
"hello world!"
Space:
O(1)
Unimplemented
Take all consecutive elements at the end of the stream for which the
predicate is true.
O(n) space, where n is the number elements taken.
Unimplemented
Like
takeWhile and
takeWhileLast combined.
O(n) space, where n is the number elements taken from the end.
Unimplemented
Drop all consecutive elements at the end of the stream for which the
predicate is true.
O(n) space, where n is the number elements dropped.
Unimplemented
Like
dropWhile and
dropWhileLast combined.
O(n) space, where n is the number elements dropped from the end.
Unimplemented