4synopsis: Beautiful Streaming, Concurrent and Reactive Composition
6 Streamly is a framework for writing programs in a high level, declarative
7 data flow programming paradigm. It provides a simple API, very close to
8 standard Haskell lists. A program is expressed as a composition of data
9 processing pipes, generally known as streams. Streams can be generated,
10 merged, chained, mapped, zipped, and consumed concurrently – enabling a high
11 level, declarative yet concurrent composition of programs. Programs can be
12 concurrent or non-concurrent without any significant change. Concurrency is
13 auto scaled based on consumption rate. Programmers do not have to be aware
14 of threads, locking or synchronization to write scalable concurrent programs.
15 Streamly provides C like performance, orders of magnitude better compared to
16 existing streaming libraries.
18 Streamly is designed to express the full spectrum of programs with highest
19 performance. Do not think that if you are writing a small and simple program
20 it may not be for you. It expresses a small "hello world" program with the
21 same efficiency, simplicity and elegance as a large scale concurrent
22 application. It unifies many different aspects of special purpose libraries
23 into a single yet simple framework.
25 Streamly covers the functionality provided by Haskell lists as well as the
26 functionality provided by streaming libraries like
27 <https://hackage.haskell.org/package/streaming streaming>,
28 <https://hackage.haskell.org/package/pipes pipes>, and
29 <https://hackage.haskell.org/package/conduit conduit> with a simpler API and
30 better performance. Streamly provides
31 advanced stream composition including various ways of appending, merging,
32 zipping, splitting, grouping, distributing, partitioning and unzipping of
33 streams with true streaming and with concurrency. Streamly subsumes the
34 functionality of list transformer libraries like @pipes@ or
35 <https://hackage.haskell.org/package/list-t list-t> and also the logic
36 programming library <https://hackage.haskell.org/package/logict logict>.
37 The grouping, splitting and windowing combinators in streamly can be compared
38 to the window operators in <https://flink.apache.org/ Apache Flink>.
39 However, compared to Flink streamly has a pure functional, succinct and
42 The concurrency capabilities of streamly are much more advanced and powerful
43 compared to the basic concurrency functionality provided by the
44 <https://hackage.haskell.org/package/async async> package. Streamly is a
45 first class reactive programming library. If you are familiar with
46 <http://reactivex.io/ Reactive Extensions> you will find that it is very
47 similar. For most RxJs combinators you can find or write corresponding ones
48 in streamly. Streamly can be used as an alternative to
49 <https://hackage.haskell.org/package/Yampa Yampa> or
50 <https://hackage.haskell.org/package/reflex reflex> as well.
52 Streamly focuses on practical engineering with high performance. From well
53 written streamly programs one can expect performance competitive to C. High
54 performance streaming eliminates the need for string and text libraries like
55 <https://hackage.haskell.org/package/bytestring bytestring>,
56 <https://hackage.haskell.org/package/text text> and their lazy and strict
57 flavors. The confusion and cognitive overhead arising from different
58 string types is eliminated. The two fundamental types in streamly are arrays
59 for storage and streams for processing. Strings and text are simply streams
60 or arrays of 'Char' as they should be. Arrays in streamly have performance
61 at par with the vector library.
63 Where to find more information:
65 * /Quick Overview/: <#readme README file> in the package
66 * /Building/: <src/docs/Build.md Build guide> for optimal performance
67 * /Detailed Tutorial/: "Streamly.Tutorial" module in the haddock documentation
68 * /Interoperation/: "Streamly.Tutorial" module for interop with other
70 * /Reference Documentation/: Haddock documentation for the respective modules
71 * /Examples/: <https://github.com/composewell/streamly-examples Streamly Examples>
72 * /Guides/: <src/docs docs directory> in the package, for documentation on
73 advanced topics, limitations, semantics of the library or on specific use
75 * <https://github.com/composewell/streaming-benchmarks Streaming Benchmarks>
76 * <https://github.com/composewell/concurrency-benchmarks Concurrency Benchmarks>
80homepage: https://github.com/composewell/streamly
81bug-reports: https://github.com/composewell/streamly/issues
84tested-with: GHC==8.0.2
89author: Composewell Technologies
90maintainer: streamly@composewell.com
91copyright: 2017 Composewell Technologies
92category: Control, Concurrency, Streaming, Reactivity
93stability: Experimental
99 .github/workflows/haskell.yml
112 benchmark/Streamly/Benchmark/Data/*.hs
113 benchmark/Streamly/Benchmark/Data/Parser/*.hs
114 benchmark/Streamly/Benchmark/Data/Stream/*.hs
115 benchmark/Streamly/Benchmark/FileSystem/*.hs
116 benchmark/Streamly/Benchmark/FileSystem/Handle/*.hs
117 benchmark/Streamly/Benchmark/Prelude/*.hs
118 benchmark/Streamly/Benchmark/Prelude/Serial/*.hs
119 benchmark/Streamly/Benchmark/Unicode/*.hs
120 benchmark/lib/Streamly/Benchmark/*.hs
121 benchmark/lib/Streamly/Benchmark/Common/*.hs
122 benchmark/streamly-benchmarks.cabal
124 bin/bench-exec-one.sh
134 charts-0/streamly-vs-list-time.svg
138 credits/Yampa-0.10.6.2.txt
139 credits/base-4.12.0.0.txt
140 credits/bjoern-2008-2009.txt
141 credits/clock-0.7.2.txt
142 credits/foldl-1.4.5.txt
143 credits/fsnotify-0.3.0.1.txt
144 credits/hfsevents-0.1.6.txt
145 credits/pipes-concurrency-2.0.8.txt
146 credits/primitive-0.7.0.0.txt
147 credits/transient-0.5.5.txt
148 credits/vector-0.12.0.2.txt
154 docs/streamly-vs-async.md
155 docs/streamly-vs-lists.md
158 src/Streamly/Internal/Data/Stream/Instances.hs
159 src/Streamly/Internal/Data/Time/Clock/config-clock.h
160 src/Streamly/Internal/Data/Array/PrimInclude.hs
161 src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs
162 src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs
163 src/Streamly/Internal/FileSystem/Event/Darwin.h
167 test/Streamly/Test/Common/Array.hs
168 test/Streamly/Test/Data/*.hs
169 test/Streamly/Test/Data/Array/Prim.hs
170 test/Streamly/Test/Data/Array/Prim/Pinned.hs
171 test/Streamly/Test/Data/Array/Foreign.hs
172 test/Streamly/Test/Data/Parser/ParserD.hs
173 test/Streamly/Test/FileSystem/Event.hs
174 test/Streamly/Test/FileSystem/Handle.hs
175 test/Streamly/Test/Network/Socket.hs
176 test/Streamly/Test/Network/Inet/TCP.hs
177 test/Streamly/Test/Prelude.hs
178 test/Streamly/Test/Prelude/*.hs
179 test/Streamly/Test/Unicode/Stream.hs
180 test/lib/Streamly/Test/Common.hs
181 test/lib/Streamly/Test/Prelude/Common.hs
182 test/streamly-tests.cabal
183 test/version-bounds.hs
192source-repository head
194 location: https://github.com/composewell/streamly
197 description: Use fusion plugin for benchmarks and executables
202 description: Enable inspection testing
207 description: Debug build with asserts enabled
212 description: Development build
217 description: Use llvm backend for code generation
222 description: Disable rewrite rules for stream fusion
227 description: Use CPS style streams when possible
232 description: Use C malloc instead of GHC malloc
237 description: off=GHC default, on=-O2
242 description: Build doctests test suite
249 cabal-doctest >= 1 && <1.1,
252-------------------------------------------------------------------------------
254-------------------------------------------------------------------------------
256common compile-options
257 default-language: Haskell2010
260 cpp-options: -DCABAL_OS_DARWIN
263 cpp-options: -DCABAL_OS_LINUX
266 cpp-options: -DCABAL_OS_WINDOWS
269 cpp-options: -DUSE_STREAMK_ONLY
272 cpp-options: -DDISABLE_FUSION
275 cpp-options: -DDEVBUILD
278 cpp-options: -DINSPECTION
280 if flag(use-c-malloc)
281 cpp-options: -DUSE_C_MALLOC
285 -Wunrecognised-warning-flags
287 -Wincomplete-record-updates
288 -Wincomplete-uni-patterns
289 -Wredundant-constraints
290 -Wnoncanonical-monad-instances
297 ghc-options: -Wmissed-specialisations
298 -Wall-missed-specialisations
300 if flag(dev) || flag(debug)
301 ghc-options: -fno-ignore-asserts
303common default-extensions
312 ExistentialQuantification
315 GeneralizedNewtypeDeriving
320 MultiParamTypeClasses
329 -- MonoLocalBinds, enabled by TypeFamilies, causes performance
330 -- regressions. Disable it. This must come after TypeFamilies,
331 -- otherwise TypeFamilies will enable it again.
334 -- UndecidableInstances -- Does not show any perf impact
335 -- UnboxedTuples -- interferes with (#.)
337common optimization-options
341 -fspec-constr-recursive=16
344common threading-options
345 ghc-options: -threaded
348-- We need optimization options here to optimize internal (non-inlined)
349-- versions of functions. Also, we have some benchmarking inspection tests
350-- part of the library when built with --benchmarks flag. Thos tests fail
351-- if we do not use optimization options here. It was observed that due to
352-- -O2 here some concurrent/nested benchmarks improved and others regressed.
353-- We can investigate a bit more here why the regression occurred.
355 import: compile-options, optimization-options, default-extensions
357-------------------------------------------------------------------------------
359-------------------------------------------------------------------------------
365 default-extensions: TypeApplications
367 default-extensions: QuantifiedConstraints
369 js-sources: jsbits/clock.js
372 c-sources: src/Streamly/Internal/Data/Time/Clock/Windows.c
373 exposed-modules: Streamly.Internal.FileSystem.Event.Windows
374 build-depends: Win32 >= 2.6 && < 2.10
378 include-dirs: src/Streamly/Internal
379 c-sources: src/Streamly/Internal/Data/Time/Clock/Darwin.c
380 , src/Streamly/Internal/FileSystem/Event/Darwin.m
382 Streamly.Internal.FileSystem.Event.Darwin
385 exposed-modules: Streamly.Internal.FileSystem.Event.Linux
390 , Streamly.Data.Prim.Array
391 , Streamly.Data.SmallArray
395 , Streamly.Data.Unfold
397 , Streamly.Data.Array.Foreign
400 , Streamly.Unicode.Stream
403 , Streamly.FileSystem.Handle
406 , Streamly.Network.Socket
407 , Streamly.Network.Inet.TCP
414 , Streamly.Data.Unicode.Stream
415 , Streamly.Memory.Array
417 -- Internal modules, listed roughly in dependency order
418 -- To view dependency graph:
419 -- graphmod | dot -Tps > deps.ps
422 , Streamly.Internal.BaseCompat
423 , Streamly.Internal.Control.Exception
424 , Streamly.Internal.Control.Monad
425 , Streamly.Internal.Control.Concurrent
426 , Streamly.Internal.Data.Cont
427 , Streamly.Internal.Data.Tuple.Strict
428 , Streamly.Internal.Data.Maybe.Strict
429 , Streamly.Internal.Data.Either.Strict
430 , Streamly.Internal.Foreign.Malloc
431 , Streamly.Internal.Data.Atomics
432 , Streamly.Internal.Data.IOFinalizer
433 , Streamly.Internal.Data.Time
434 , Streamly.Internal.Data.Time.TimeSpec
435 , Streamly.Internal.Data.Time.Units
436 , Streamly.Internal.Data.Time.Clock.Type
437 , Streamly.Internal.Data.Time.Clock
439 -- streamly-core-stream
440 , Streamly.Internal.Data.SVar
441 , Streamly.Internal.Data.Stream.StreamK.Type
442 , Streamly.Internal.Data.Fold.Type
443 , Streamly.Internal.Data.Stream.StreamD.Step
444 , Streamly.Internal.Data.Stream.StreamD.Type
445 , Streamly.Internal.Data.Stream.StreamDK.Type
446 , Streamly.Internal.Data.Unfold.Type
447 , Streamly.Internal.Data.Producer.Type
448 , Streamly.Internal.Data.Producer
449 , Streamly.Internal.Data.Producer.Source
450 , Streamly.Internal.Data.Sink.Type
451 , Streamly.Internal.Data.Parser.ParserK.Type
452 , Streamly.Internal.Data.Parser.ParserD.Type
453 , Streamly.Internal.Data.Pipe.Type
456 , Streamly.Internal.Data.IORef.Prim
458 -- streamly-core-array
459 -- May depend on streamly-core-stream
460 , Streamly.Internal.Data.Array.Foreign.Mut.Type
461 , Streamly.Internal.Data.Array.Foreign.Type
462 , Streamly.Internal.Data.Array.Prim.Mut.Type
463 , Streamly.Internal.Data.Array.Prim.Type
464 , Streamly.Internal.Data.Array.Prim.Pinned.Mut.Type
465 , Streamly.Internal.Data.Array.Prim.Pinned.Type
466 , Streamly.Internal.Data.SmallArray.Type
468 -- streamly-base-streams
469 , Streamly.Internal.Data.Stream.StreamK
470 -- StreamD depends on streamly-core-array
471 , Streamly.Internal.Data.Stream.StreamD.Generate
472 , Streamly.Internal.Data.Stream.StreamD.Eliminate
473 , Streamly.Internal.Data.Stream.StreamD.Nesting
474 , Streamly.Internal.Data.Stream.StreamD.Transform
475 , Streamly.Internal.Data.Stream.StreamD.Exception
476 , Streamly.Internal.Data.Stream.StreamD.Lift
477 , Streamly.Internal.Data.Stream.StreamD
478 , Streamly.Internal.Data.Stream.StreamDK
479 , Streamly.Internal.Data.Stream.Prelude
481 , Streamly.Internal.Data.Parser.ParserD.Tee
482 , Streamly.Internal.Data.Parser.ParserD
485 , Streamly.Internal.Data.Unfold
486 , Streamly.Internal.Data.Fold.Tee
487 , Streamly.Internal.Data.Fold
488 , Streamly.Internal.Data.Sink
489 , Streamly.Internal.Data.Parser
490 , Streamly.Internal.Data.Pipe
492 , Streamly.Internal.Data.Stream.SVar
493 , Streamly.Internal.Data.Stream.Serial
494 , Streamly.Internal.Data.Stream.Async
495 , Streamly.Internal.Data.Stream.Parallel
496 , Streamly.Internal.Data.Stream.Ahead
497 , Streamly.Internal.Data.Stream.Zip
498 , Streamly.Internal.Data.Stream.IsStream.Combinators
499 , Streamly.Internal.Data.Stream.IsStream.Common
500 , Streamly.Internal.Data.Stream.IsStream.Types
501 , Streamly.Internal.Data.Stream.IsStream.Enumeration
502 , Streamly.Internal.Data.Stream.IsStream.Generate
503 , Streamly.Internal.Data.Stream.IsStream.Eliminate
504 , Streamly.Internal.Data.Stream.IsStream.Transform
505 , Streamly.Internal.Data.Stream.IsStream.Expand
506 , Streamly.Internal.Data.Stream.IsStream.Reduce
507 , Streamly.Internal.Data.Stream.IsStream.Exception
508 , Streamly.Internal.Data.Stream.IsStream.Lift
509 , Streamly.Internal.Data.Stream.IsStream.Top
510 , Streamly.Internal.Data.Stream.IsStream
511 , Streamly.Internal.Data.List
514 -- May depend on streamly-core
515 , Streamly.Internal.Data.Array
516 , Streamly.Internal.Data.Array.Foreign
517 , Streamly.Internal.Data.Array.Prim
518 , Streamly.Internal.Data.Array.Prim.Pinned
519 , Streamly.Internal.Data.SmallArray
520 , Streamly.Internal.Data.Array.Stream.Mut.Foreign
521 , Streamly.Internal.Data.Array.Stream.Foreign
524 , Streamly.Internal.Ring.Foreign
527 , Streamly.Internal.Unicode.Stream
528 , Streamly.Internal.Unicode.Char
529 , Streamly.Internal.Unicode.Array.Char
530 , Streamly.Internal.Unicode.Array.Prim.Pinned
533 , Streamly.Internal.Data.Binary.Decode
535 -- streamly-filesystem
536 , Streamly.Internal.FileSystem.Handle
537 , Streamly.Internal.FileSystem.Dir
538 , Streamly.Internal.FileSystem.File
539 , Streamly.Internal.FileSystem.IOVec
540 , Streamly.Internal.FileSystem.FDIO
541 , Streamly.Internal.FileSystem.FD
544 , Streamly.Internal.Network.Socket
545 , Streamly.Internal.Network.Inet.TCP
548 -- Core libraries shipped with ghc, the min and max
549 -- constraints of these libraries should match with
550 -- the GHC versions we support
552 , containers >= 0.5 && < 0.7
553 , deepseq >= 1.4.1 && < 1.5
554 , directory >= 1.2.2 && < 1.4
555 , exceptions >= 0.8 && < 0.11
556 , ghc-prim >= 0.2 && < 0.8
558 , primitive >= 0.5.4 && < 0.8
559 , transformers >= 0.4 && < 0.6
561 , heaps >= 0.3 && < 0.5
564 , atomic-primops >= 0.8 && < 0.9
565 , lockfree-queue >= 0.2.3 && < 0.3
568 , monad-control >= 1.0 && < 2
569 , transformers-base >= 0.4 && < 0.5
571 , fusion-plugin-types >= 0.1 && < 0.2
574 , network >= 2.6 && < 4
578 build-depends: template-haskell >= 2.14 && < 2.17
579 , inspection-testing >= 0.4 && < 0.5
581 -- Array uses a Storable constraint in dev build making several inspection
583 if flag(dev) && flag(inspection)
584 build-depends: inspection-and-dev-flags-cannot-be-used-together
587 type: exitcode-stdio-1.0
592 , base-compat >=0.10.5 && <0.12
593 , doctest >=0.15 && <0.18
598 ghc-options: -Wall -threaded
600 default-language: Haskell2010
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list