
Folks, Are there any zlib bindings for Haskell? The docs for HDirect mention the examples directory with the bindings but I cannot find the examples directory in the source distro. The MissingH code works with gzipped files apparently but not with memory buffers. Thanks, Joel -- http://wagerlabs.com/

I need to deflate buffers that were compressed with zlib's compress and sent to me over the network. I don't think files help me there :-). On Oct 18, 2005, at 3:49 PM, Henning Thielemann wrote:
Darcs works with gzipped files.

Joel Reymont
I need to deflate buffers that were compressed with zlib's compress and sent to me over the network. I don't think files help me there :-).
Bzlib and zlib wrappers are available in http://www.sourceforge.net/projects/qforeign/ for ghc >= 4.08 and nhc98 >= 1.02. Author: Marcin 'Qrczak' Kowalczyk. Regards, Malcolm

On 2005-10-18, Joel Reymont
Are there any zlib bindings for Haskell? The docs for HDirect mention the examples directory with the bindings but I cannot find the examples directory in the source distro.
The MissingH code works with gzipped files apparently but not with memory buffers.
Actually, check out: http://quux.org/devel/missingh/html/MissingH-FileArchive-GZip.html#v%3Adecom... It will work with String buffers. Now, having said that, this code is slow, for a variety of reasons. Whether or not it is fast enough for you probably depends on your network. I also have bindings to gzip and bzip2 in MissingPy; however, they are currently written for on-disk files only. -- John

joelr1:
Folks,
Are there any zlib bindings for Haskell? The docs for HDirect mention the examples directory with the bindings but I cannot find the examples directory in the source distro.
The MissingH code works with gzipped files apparently but not with memory buffers.
Check out the zlib code in FPS possibly, which came from darcs :) -- Don

Well, I just coded this. Feedback is welcome!
One thing that I found interesting is that I actually have to
allocate 4 bytes to pass the long into compress/uncompress. I thought
that I could somehow obtain the address of the Haskell variable but
this does not seem to be possible.
Thanks, Joel
--
{-# INCLUDE

FastString seems to be a misnomer for this library. what it provides is a fast _byte array_ with a lot of useful operations, but it does not provide strings since it does not enforce character encodings in the type system, which would be vital for a real FastString library. In any case, just had to get that off my chest :) John -- John Meacham - ⑆repetae.net⑆john⑈

Hello John, Thursday, October 20, 2005, 4:12:36 AM, you wrote: JM> FastString seems to be a misnomer for this library. JM> what it provides is a fast _byte array_ with a lot of useful JM> operations, but it does not provide strings since it does not enforce JM> character encodings in the type system, which would be vital for a real JM> FastString library. In any case, just had to get that off my chest :) may be it can be named ByteArray? and then FastString.Latin1, FastString.UTF8... will use its utilities also, all UTF8 utilities may be placed outside of FastString.UTF8 module, because it can be used for something else btw, FastString is also a bit misnamed. it's really a CompactString. ghc's FastString was named so, imho, just because they provided hashes for fast string comparision -- Best regards, Bulat mailto:bulatz@HotPOP.com

bulatz:
Hello John,
Thursday, October 20, 2005, 4:12:36 AM, you wrote:
JM> FastString seems to be a misnomer for this library.
JM> what it provides is a fast _byte array_ with a lot of useful JM> operations, but it does not provide strings since it does not enforce JM> character encodings in the type system, which would be vital for a real JM> FastString library. In any case, just had to get that off my chest :)
may be it can be named ByteArray? and then FastString.Latin1, FastString.UTF8... will use its utilities
also, all UTF8 utilities may be placed outside of FastString.UTF8 module, because it can be used for something else
btw, FastString is also a bit misnamed. it's really a CompactString. ghc's FastString was named so, imho, just because they provided hashes for fast string comparision
Well, it's a PackedString really, isn't it? I changed it to FastString after too many people grumbled about colliding with the existing PackedString. -- Don

Hello Donald, Thursday, October 20, 2005, 12:47:32 PM, you wrote:
JM> what it provides is a fast _byte array_ with a lot of useful
may be it can be named ByteArray? and then FastString.Latin1,
DBS> Well, it's a PackedString really, isn't it? of course :) btw, may be it can be extended by processing any memory arrays, not just ByteArray? smthg like data Vector a = PS !Int !(ForeignPtr a) -- Best regards, Bulat mailto:bulatz@HotPOP.com
participants (7)
-
Bulat Ziganshin
-
dons@cse.unsw.edu.au
-
Henning Thielemann
-
Joel Reymont
-
John Goerzen
-
John Meacham
-
Malcolm Wallace