High performance, concurrent functional programming abstractions
Go to file
Harendra Kumar 1707e0de9e Fix badges
2017-11-21 00:27:39 +05:30
benchmark Rename to Streamly 2017-11-20 18:03:13 +05:30
examples Rename to Streamly 2017-11-20 18:03:13 +05:30
src Rename to Streamly 2017-11-20 18:03:13 +05:30
test Comment out incorrect test 2017-11-20 22:14:39 +05:30
.travis.yml Update the package-test ci script version 2017-10-20 09:34:53 +05:30
appveyor.yml Update the package-test ci script version 2017-10-20 09:34:53 +05:30
LICENSE Use BSD 3-clause license for the lazy implementation 2017-09-04 15:56:05 +05:30
README.md Fix badges 2017-11-21 00:27:39 +05:30
stack.yaml Comment out /opt/local/include path inclusion 2017-10-21 03:22:43 +05:30
streamly.cabal Rename to Streamly 2017-11-20 18:03:13 +05:30

Streamly

Gitter chat Build Status Windows Build status Coverage Status

Streamly is a general streaming and concurrent programming monad allowing you to write a wide variety of applications ranging from simple applications utilizing streaming IO to massively parallel concurrent applications as well as reactive (FRP) applications with the same ease. Streamly provides high level concurrency primitives and hides the low level concurrency details completely from the programmer. The programmer just expresses whether a task can run in parallel with another. Threads, synchronization and concurrency rate control are handled automatically. The library has been written keeping high performance applications in mind.

Streamly subsumes all the use cases of list transformer (list-t) and logic programming (logict) monads and adds concurrency on top. It is a streaming library and therefore can be used for most of the streaming use cases as well (i.e. where you would use conduit or pipes) with concurrency added. It is also a first class reactive programming library and can be used where you would use libraries like Yampa or reflex. One way to think about it is to think of it as composable state machines with concurrency. You can write from really simple to complex applications, from streaming to FRP or massively concurrent applications using the same simple and concise abstractions.

Here is a simple example to concurrently and recursively list the contents of a directory tree:

import Path.IO (listDir, getCurrentDir)
import Streamly

main = runStreaming $ serially $ getCurrentDir >>= readdir
   where readdir d = do
            (dirs, files) <- lift $ listDir d
            liftIO $ mapM_ putStrLn $ map show files
            foldMapWith (<|>) readdir dirs

See "Streamly.Tutorial" and "Streamly.Examples" for more details.

This library was originally inspired by the transient package authored by Alberto G. Corona.