IterIO is Haskell IO library providing an alternative to lazy IO with
better error handling, referential transparency, and convenient
composition of protocol layers or parsers.
IterIO is an implementation of the iteratee concept, which has
been previously proposed and implemented multiple times. The goal of
IterIO is to make iteratees far easier to learn and use than previous
implementations. The library's interface centers around the idea of
pipeline stages reminiscent of Unix command pipelines. Some aspects
of iterIO that should simplify learning and using iteratees are:
- Every aspect of the library is thoroughly document in haddock
including numerous examples of use.
- Enumerators are easy to build out of iteratees.
- There is no difference between enumerators and "enumeratees"
(i.e., inner pipeline stages). The former is just a
type-restricted version of the latter.
- Parsing combinators provide detailed error reporting and support
LL(*) rather than LL(1) parsing, leading to fewer non-intuitive
parsing failures. A couple of tricks avoid consuming excessive
memory for backtracking.
- Super-fast LL(1) parsing is also available through seamless
integration with attoparsec.
- A universal exception mechanism works across invocations of mtl
monad transformers, thereby unifying error handling.
- All pipe operators have uniform semantics, eliminating corner
cases. In particular, if the writing end of a pipe fails, the
reading end always gets EOF, allowing it to clean up resources.
- One can catch exceptions thrown by any contiguous subset of
stages in a pipeline. Moreover, enumerator exception handlers
can resume downstream stages that haven't failed.
- The package is full of useful iteratees and enumerators,
including basic file and socket processing, parsec-like
combinators, string search, zlib/gzip compression, SSL, HTTP, and
"loopback" enumerator/iteratee pairs for testing a protocol
implementation against itself.
- iterIO documentation
- iterIO git repository:
git clone http://www.scs.stanford.edu/~dm/repos/iterIO.git