This page contains sources of my FreeArc program and its companion libraries. You can browse FreeArc sources if you want to see examples of  using these libraries in real application. If you have any questions, mail me at or My new homepage is



FreeArc archiver

Project Status: beta, actively developed


FreeArc is an archiver program (like Info-ZIP). This class of programs are traditionally written in C/C++ (so-called “system programming”), so I was interested – how Haskell can compete with C++ in this field? By dividing program in two parts – computation-intensive compression library, written in C++, and all other code – working with lists of files, working with archive structure, interfacing with user – written in Haskell, I have got the resulting program competitive with archivers written in C++ (RAR, 7-zip, UHARC), while cutting in several times development time and especially number of errors, maked during development. Also, during development I have written several general-purpose Haskell libraries, which you can find on this page. You can download program sources if you are interesting in replacing C++ with Haskell or developing general utilities with Haskell, and want to learn programming techniques suitable for this case. Program sources are extensively commented... in Russian language J





Compression-2005 library

Project Status: stable, actively developed


Compression-2005 Library features:

·                    easy and uniform access to most competitive compression algorithms as of April’05: LZMA, PPMd and GRZip

·                    all input/output performed via user-supplied functions (callbacks), so you can compress data in memory, files, pipes, sockets and anything else

·                    all parameters of compression algorithm are defined with a single string, for example “lzma:8mb:fast:hc4:fb32”


So, entire compression program can be written as one-liner:

compress “ppmd:10:48mb” (hGetBuf stdin) (\buf size  ->  hPutBuf stdout buf size  >>  return size)

with decompressor program:

decompress “ppmd:10:48mb” (hGetBuf stdin) (\buf size  ->  hPutBuf stdout buf size  >>  return size)

You can replace “ppmd:10:48mb” with “lzma:16mb” or “grzip” to get another two compressors – all three will compress faster and better than bzip2, sorry J.


Of course, primary purpose of this library is to give you a possibility to use state-of-the-art compression as integral part of your Haskell programs.





ByteStream library

Project Status: beta, actively developed


ByteStream is like NHC Binary library – it provides marshalling of Haskell objects to byte stream and restoring them back. Features:

·                    light-fast speed, but only x86 processors compatible (used unaligned memory access)

·                    using callbacks to read and write data (in large chunks) to byte stream, so it can go on-the-fly to memory, file or, for example, sent to another PC

·                    using variable-length format for Integers and list lengths (1-9 bytes, dependent on value)


Example of very basic usage:

ByteStream.writeFile “test” [1..1000::Integer]

(restored::[Integer]) <- ByteStream.readFile “test”


Download sources: ByteStream.tar.gz



Process library

Project Status: beta, actively developed


Process is a fun library for easing decomposition algorithms to several processes, which transmit intermediate data via Unix-like pipes. You can write, for example: “runP$ producer |> transformer1 |> transformer2 |> printer”, where each “sub-process” in transporter is just a function started with forkIO/forkOS with one additional parameter – “pipe”. This pipe can be “read” with receiveP function to get data from previous process in transporter, and “written” with sendP to send data to next process. Pipe can be made one-element (MVar) with “|>” operator, or multi-element (Chan) with “|>>>”. Also supported “back pipe” which can be used to return to previous process acknowledgements or, for example, borrowed buffers. Process or entire transporter can also be run asynchronously and then communicated via returned pipe: “pipe <- runAsyncP$ transformer1 |> transformer2”. Moreover, process/transporter can be run against 4 functions, which will be used for all it’s piping operations, what opens whole range of possibilities to create more complex process-control structures.


This lead to situation when Process, while more a syntactic sugar for well-known forkOS/MVar/Chan ingredients, than a “real” library, has become a very useful tool for assembling complex algorithms from simple pieces, which somehow transforms data. This is like situation of Unix popularity because it provides the same instruments for assembling together separate simple programs, but in this case you don’t transmit plain byte stream, but typed data.


Download sources: Process.tar.gz

Hosted by uCoz