-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for tracking the consumption of a lazy ByteString -- @package bytestring-progress @version 1.0.0 -- | This module defines core functions for tracking the consumption of a -- ByteString, as well as several helper functions for making tracking -- ByteStrings easier. module Data.ByteString.Lazy.Progress -- | Given a function, return a bytestring that will call that function -- when it is partially consumed. The Words provided to the function will -- be the number of bytes that were just consumed and the total bytes -- consumed thus far. trackProgress :: (Word64 -> Word64 -> IO ()) -> ByteString -> IO ByteString -- | Works like trackProgress, except uses fixed-size chunks of the -- given size. Thus, for this function, the first number passed to your -- function will always be the given size *except* for the last call to -- the function, which will be less then or equal to the final size. trackProgressWithChunkSize :: Word64 -> (Word64 -> Word64 -> IO ()) -> ByteString -> IO ByteString -- | Given a format string (described below), track the progress of a -- function. The argument to the callback will be the string expanded -- with the given progress information. -- -- Format string items: -- -- -- -- If you provide a total size (the maybe argument, in bytes), then you -- may also use the following items: -- -- trackProgressString :: String -> Maybe Word64 -> (String -> IO ()) -> IO (ByteString -> IO ByteString) -- | Exactly as trackProgressString, but use the given chunkSize -- instead of the default chunk size. trackProgressStringWithChunkSize :: String -> Word64 -> Maybe Word64 -> (String -> IO ()) -> IO (ByteString -> IO ByteString) -- | Convert a number of bytes to a string represenation that uses a -- reasonable unit to make the number human-readable. bytesToUnittedStr :: Word64 -> String