takeWhile -containers -base

takeWhile :: (Char -> Bool) -> ByteString -> ByteString
bytestring Data.ByteString.Char8, bytestring Data.ByteString.Lazy.Char8
takeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.
takeWhile :: (Char -> Bool) -> Text -> Text
text Data.Text, text Data.Text.Lazy
O(n) takeWhile, applied to a predicate p and a Text, returns the longest prefix (possibly empty) of elements that satisfy p. Subject to fusion.
takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString
bytestring Data.ByteString, bytestring Data.ByteString.Lazy
takeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.