@hackage / io-streams

Simple, composable, and easy-to-use stream I/O

Latest1.5.2.2

About

Metadata

  • Last updated , by AndreasAbel
  • License BSD-3-Clause
  • Categories Network Development
  • Maintained by: Gregory Collins <greg@gregorycollins.net>

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.10.3
  3. 9.8.4
  4. 9.6.7
  5. 9.4.8
  6. 9.2.8
  7. 9.0.2
  8. 8.10.7
  9. 8.8.4
  10. 8.6.5

Package Flags

Use the -f option with cabal commands to enable flags

    nointeractivetests (off by default)

    Do not run interactive tests

    zlib (on by default)

    Include zlib support

    network (on by default)

    Include network support

Readme

The io-streams library contains simple and easy to use primitives for I/O using streams. Based on simple types with one type parameter (InputStream a and OutputStream a), io-streams provides a basic interface to side-effecting input and output in IO monad with the following features:

  • three fundamental I/O primitives that anyone can understand: read :: InputStream a -> IO (Maybe a), unRead :: a -> InputStream a -> IO (), and write :: Maybe a -> OutputStream a -> IO ().

  • simple types and side-effecting IO operations mean straightforward and simple exception handling and resource cleanup using standard Haskell facilities like bracket.

  • code to transform files, handles, and sockets to streams

  • a variety of combinators for wrapping and transforming streams, including compression and decompression using zlib, controlling precisely how many bytes are read to or written from a socket, buffering output using blaze-builder, etc.

  • support for parsing from streams using attoparsec.