take -containers +bytestring
O(1) take n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > length xs.
O(n\c)/ take n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > length xs.
takeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.
takeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.
A variety of take which omits the checks on n so there is an obligation on the programmer to provide a proof that 0 <= n <= length xs.