As a learning exercise, I'm trying to use the Backpack module system to give a common interface to the main streaming libraries of Haskell: conduit, pipes, streaming. (Inspired by how str-sig gives a common interface to String-like types.)
Structure of this project
- streamy-sig is the abstract signature.
- streamy-bytes-sig expands streamy-sig with a module signature for byte streams.
- streamy-pipes is the pipes "bridge" package.
- streamy-testsuite test each of the implementations using a shared set of tests.
Do I need all these packages?
Not really, even if you still want to use Backpack to abstract your streaming library.
You can always define a self-contained signature in your own library, and the users of your library can define their own "bridge" implementations to make the types line up.
The advantage of these premade packages is not having to invent your own signatures and bridge modules.
Built using cabal 2.0.
cabal new-build all --enable-tests
cabal new-test streamy-testsuite
Where can I find further information on Backpack?
Edward Z. Yang's thesis is quite readable.
Designing the Backpack signature ecosystem explains the usefulness of signature thinning (see also section 2.7 of the thesis).
The str-sig signature package and its various implementations.