iteratee countBytes, modifier which counts 'bytes'
lang at tsurucapital.com
Thu Jan 5 10:03:05 GMT 2012
Here is a patch for a function
countBytes :: forall m s a el. (Monad m, LL.ListLike s el, Nullable s)
=> I.Iteratee s m a -> I.Iteratee s m (a, Int64)
which keeps track of the number of 'bytes' (in fact not necessarily
bytes) consumed by an iteratee. It was inspired by countBytes in
snap-core, and Conrad Parker has had some use for it. I've also
included a quickcheck test called prop_countBytes. Perhaps something
like countUsage or trackUsage is a better name?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 12859 bytes
Desc: not available
More information about the Iteratee