takeWhile package:text

O(n) takeWhile, applied to a predicate p and a Text, returns the longest prefix (possibly empty) of elements that satisfy p.
takeWhile, applied to a predicate p and a stream, returns the longest prefix (possibly empty) of elements that satisfy p. Properties
unstream . takeWhile p . stream = takeWhile p
O(n) takeWhileEnd, applied to a predicate p and a Text, returns the longest suffix (possibly empty) of elements that satisfy p. Examples:
>>> takeWhileEnd (=='o') "foo"
"oo"
O(n) takeWhileEnd, applied to a predicate p and a Text, returns the longest suffix (possibly empty) of elements that satisfy p. Examples:
takeWhileEnd (=='o') "foo" == "oo"