happstack-util- Web framework



Compatiblity for ByteStrings



breakChar :: Char -> ByteString -> (ByteString, ByteString)Source

Semantically equivalent to break on strings

breakCharEnd :: Char -> ByteString -> (ByteString, ByteString)Source

breakCharEnd behaves like breakChar, but from the end of the ByteString.

 breakCharEnd ('b') (pack "aabbcc") == ("aab","cc")

and the following are equivalent:

 breakCharEnd 'c' "abcdef"
 let (x,y) = break (=='c') (reverse "abcdef")
 in (reverse (drop 1 y), reverse x)

dropSpace :: ByteString -> ByteStringSource

Drops leading spaces in the ByteString

dropSpaceEnd :: ByteString -> ByteStringSource

Drops trailing spaces in the ByteString

rechunkLazy :: ByteString -> ByteStringSource

Chunk a lazy bytestring into reasonable chunks - is id from outside. This is useful to make bytestring chunks reasonable sized for e.g. compression.