Gregory Collins | 5 Mar 23:07 2013

ANNOUNCE: io-streams

Hi all,

After more than eight months of careful design and development, The Snap Framework team is happy to announce the first version of io-streams, a simple and easy-to-use library for doing streaming I/O in Haskell.

The io-streams library is based around two basic types, InputStream a and OutputStream a, and three fundamental I/O primitives:

-- read an item from an input stream
read :: InputStream a -> IO (Maybe a)
-- push an item back to an input stream
unRead :: a -> InputStream a -> IO ()
-- write to an output stream
write :: Maybe a -> OutputStream a -> IO ()

Streams can be transformed by composition and hooked together (using Kleisli composition) with a large set of provided combinators.

Simple types and operations in the IO monad mean straightforward and simple exception handling and resource cleanup using Haskell standard library functions like bracket.

The io-streams library comes with:
  • functions to use files, handles, concurrent channels, sockets, lists, vectors, and more as streams.
  • a plethora of combinators for wrapping and transforming streams, including compression and decompression using zlib, controlling precisely how many bytes are read from or written to a stream, buffering output using bytestring builders, folds, maps, filters, zips, etc.
  • support for parsing from streams using attoparsec.
For first-time users, io-streams comes with an included tutorial in theSystem.IO.Streams.Tutorial module, written by Gabriel Gonzalez of “pipes” fame.

The io-streams library is tested on GHC 7.0, 7.2, 7.4, and 7.6, and includes an extensive test suite with 100% function, statement, and branch coverage.

We would like to acknowledge the financial assistance of Erudify AG, who graciously funded some of the documentation and development of the io-streams library. Many thanks are also due to Gabriel Gonzalez, Andrew Cowie, Johan Tibell, and Bas van Dijk for their helpful discussions, contributions, and review.

For further details, you can read our release announcement here:

Gregory Collins <greg <at>>
Haskell-Cafe mailing list
Haskell-Cafe <at>
s9gf4ult | 6 Mar 04:36 2013

Re: ANNOUNCE: io-streams

Is this something like conduits ?
Erik de Castro Lopo | 6 Mar 06:10 2013

Re: ANNOUNCE: io-streams

s9gf4ult wrote:

> Is this something like conduits ?

Yes, its also a bit like Iteratee, Enumerator, Pipes and Machines.


Erik de Castro Lopo
Alfredo Di Napoli | 6 Mar 09:08 2013

Re: ANNOUNCE: io-streams

As I've already said on Reddit,

awesome job guys. From the little I've seen the API is very lean and easy, so I'm really looking forward to playing with it and helping you with it as well :)

Haskell-Cafe mailing list
Haskell-Cafe <at>