list-t-text 0.1.0.2 → 0.2.0.0
raw patch · 2 files changed
+11/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- ListT.Text: utf8ByteString :: Monad m => Transformation m ByteString Text
+ ListT.Text: decodeUTF8 :: Monad m => Transformation m ByteString Text
+ ListT.Text: stream :: Monad m => Int -> Text -> ListT m Text
Files
- library/ListT/Text.hs +10/−2
- list-t-text.cabal +1/−1
library/ListT/Text.hs view
@@ -13,8 +13,8 @@ -- | -- A transformation of a stream of byte-strings -- to a stream of text chunks decoded using UTF-8.-utf8ByteString :: Monad m => Transformation m ByteString Text-utf8ByteString =+decodeUTF8 :: Monad m => Transformation m ByteString Text+decodeUTF8 = loop TE.streamDecodeUtf8 where loop decode stream =@@ -24,3 +24,11 @@ decode chunk & \(TE.Some result leftover decode') -> bool (cons result) id (T.null result) (loop decode' stream') +-- |+-- Stream text in chunks of the specified size.+stream :: Monad m => Int -> Text -> ListT m Text+stream n b =+ T.splitAt n b & \(l, r) -> + if T.null l+ then mzero+ else cons l (stream n r)
list-t-text.cabal view
@@ -1,7 +1,7 @@ name: list-t-text version:- 0.1.0.2+ 0.2.0.0 synopsis: A streaming text codec category: