[Haskell-cafe] A home-brew iteration-alike library: some extension quiestions

John Lato jwlato at gmail.com
Mon Dec 13 10:41:04 CET 2010


From: Permjacov Evgeniy <permeakra at gmail.com>

>
> Hi. I Wrote a simple iteration library. It was not intensively tested,
> so it MAY contatin bugs, but it is very unlikely. The library is
> currently on github: https://github.com/permeakra/iteration
>
> I'm not ready to upload it to hackage, as some testing and extension is
> really needed. However, I'd like to know about possible flaws.
>
> Current goal is addition of byte-stream (de)compression and IO functions
> extenstion. After this package will be cabalized and uploaded to
> hackage. So, while design is not frozen yet, I'm interested in criticism
> -)/
>

First, I haven't examined your code in sufficient depth to fully understand
it, so I may be off the mark with this comment.  However, I'm not convinced
it's possible to safely implement zipping in iteration-style IO without
another technique (e.g. monadic regions), by which I mean I suspect any code
which exposes enough control to pause an enumeration (or alternatively
allows a user-supplied termination check to the enumerator) will also not
provide guaranteed finalization/garbage collection of the underlying
resource (e.g. handle).

I also require zipping of streams, and in fact it is possible with
iteratee.  I haven't included the code in the library because I was formerly
not convinced of its safety.  I do think it's safe now, but only by use of a
monadic region.

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101213/ef9cc504/attachment.htm>


More information about the Haskell-Cafe mailing list