takeWhile -text

takeWhile :: (a -> Bool) -> [a] -> [a]
base Prelude, base Data.List
takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p: > takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] > takeWhile (< 9) [1,2,3] == [1,2,3] > takeWhile (< 0) [1,2,3] == []
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 :: (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.
takeWhileL :: (a -> Bool) -> Seq a -> Seq a
containers Data.Sequence
O(i) applied to a predicate p and a sequence xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.
takeWhileR :: (a -> Bool) -> Seq a -> Seq a
containers Data.Sequence
O(i) applied to a predicate p and a sequence xs, returns the longest suffix (possibly empty) of xs of elements that satisfy p. takeWhileR p xs is equivalent to reverse (takeWhileL p (reverse xs)).