churros: Channel/Arrow based streaming computation library.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

The Churro library takes an opinionated approach to streaming by focusing on IO processes and allowing different transport options.

[Skip to Readme]


Change log
Dependencies async, base (>=4.10 && <4.15), containers, random, stm, time, unagi-chan [details]
License MIT
Author Lyndon Maydwell
Category Data, Control
Home page
Bug tracker
Source repo head: git clone
Uploaded by LyndonMaydwell at 2020-10-19T23:16:26Z




Maintainer's Corner

For package maintainers and hackage trustees

Readme for churros-

[back to package description]


Chan + Arrow = Churro

Simple alternative to Conduit, Pipes, Streaming, Machines, etc.

Use-case is CSP like scenarios where you need a graph of actors.

Signup Example:

New-Users -->  Validate -------?----->  Deploy  -----?--------------> Log
Subscribe    REST Request      |      Run Server     |         Write File
{-> ID}    {ID -> (ID,Email}   |    {Email -> Port}  |  {Port|Receipt ->}
                               |                     |
                               +-------> Warn -------+
                                      Send Email
                                  {Email -> Receipt}

Developed from a history of attempting to use co-routines libraries for setting up complicated asynchronous processes such as collections of MIDI instruments, etc, but being frustrated by not easily being able to conditionally consume and emit events. In these situations I'd fall back on creating a bunch of Chans and piping events manually. Churros just formalises that strategy to help you get it right!

Advantages over other alternatives:


See Hackage for more info!


See ./test/ directory for more extensive examples.

import Control.Churro

main = do
   runWaitChan             $ sourceList [1..10] >>> processDebug "after source" >>> delay 1 {- seconds -} >>> arr succ >>> sinkPrint
   (wait =<<)  $ run @Chan $ sourceIO (\cb -> cb 1 >> print "Doing whatever!" >> cb 5) >>> filterC (> 3) >>> sinkIO print


Cabal test-suite including doctests:

cabal exec cabal test

Or for itterative development:

find {src,test} | entr -- cabal exec -- doctest -isrc -itest test/Churro/Test/Examples.hs