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
98 .github/workflows/haskell.yml
111 benchmark/Streamly/Benchmark/Data/*.hs
112 benchmark/Streamly/Benchmark/Data/Parser/*.hs
113 benchmark/Streamly/Benchmark/Data/Stream/*.hs
114 benchmark/Streamly/Benchmark/FileSystem/*.hs
115 benchmark/Streamly/Benchmark/FileSystem/Handle/*.hs
116 benchmark/Streamly/Benchmark/Prelude/*.hs
117 benchmark/Streamly/Benchmark/Prelude/Serial/*.hs
118 benchmark/Streamly/Benchmark/Unicode/*.hs
119 benchmark/lib/Streamly/Benchmark/*.hs
120 benchmark/lib/Streamly/Benchmark/Common/*.hs
121 benchmark/streamly-benchmarks.cabal
123 bin/bench-exec-one.sh
131 charts-0/streamly-vs-list-time.svg
135 credits/Yampa-0.10.6.2.txt
136 credits/base-4.12.0.0.txt
137 credits/bjoern-2008-2009.txt
138 credits/clock-0.7.2.txt
139 credits/foldl-1.4.5.txt
140 credits/fsnotify-0.3.0.1.txt
141 credits/hfsevents-0.1.6.txt
142 credits/pipes-concurrency-2.0.8.txt
143 credits/primitive-0.7.0.0.txt
144 credits/transient-0.5.5.txt
145 credits/vector-0.12.0.2.txt
151 docs/streamly-vs-async.md
152 docs/streamly-vs-lists.md
155 src/Streamly/Internal/Data/Stream/Instances.hs
156 src/Streamly/Internal/Data/Time/config-clock.h
157 src/Streamly/Internal/Data/Array/PrimInclude.hs
158 src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs
159 src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs
160 src/Streamly/Internal/FileSystem/Event/Darwin.h
164 test/Streamly/Test/Common/Array.hs
165 test/Streamly/Test/Data/*.hs
166 test/Streamly/Test/Data/Array/Prim.hs
167 test/Streamly/Test/Data/Array/Prim/Pinned.hs
168 test/Streamly/Test/Data/Array/Storable/Foreign.hs
169 test/Streamly/Test/Data/Parser/ParserD.hs
170 test/Streamly/Test/FileSystem/Event.hs
171 test/Streamly/Test/FileSystem/Handle.hs
172 test/Streamly/Test/Network/Socket.hs
173 test/Streamly/Test/Network/Inet/TCP.hs
174 test/Streamly/Test/Prelude.hs
175 test/Streamly/Test/Prelude/*.hs
176 test/Streamly/Test/Unicode/Stream.hs
177 test/lib/Streamly/Test/Common.hs
178 test/lib/Streamly/Test/Prelude/Common.hs
179 test/streamly-tests.cabal
180 test/version-bounds.hs
189source-repository head
191 location: https://github.com/composewell/streamly
194 description: Use fusion plugin for benchmarks and executables
199 description: Enable inspection testing
204 description: Debug build with asserts enabled
209 description: Development build
214 description: Use llvm backend for code generation
219 description: Disable rewrite rules for stream fusion
224 description: Use CPS style streams when possible
229 description: Use C malloc instead of GHC malloc
234 description: off=GHC default, on=-O2
238-------------------------------------------------------------------------------
240-------------------------------------------------------------------------------
242common compile-options
243 default-language: Haskell2010
246 cpp-options: -DCABAL_OS_DARWIN
249 cpp-options: -DCABAL_OS_LINUX
252 cpp-options: -DCABAL_OS_WINDOWS
255 cpp-options: -DUSE_STREAMK_ONLY
258 cpp-options: -DDISABLE_FUSION
261 cpp-options: -DDEVBUILD
264 cpp-options: -DINSPECTION
266 if flag(use-c-malloc)
267 cpp-options: -DUSE_C_MALLOC
271 -Wunrecognised-warning-flags
273 -Wincomplete-record-updates
274 -Wincomplete-uni-patterns
275 -Wredundant-constraints
276 -Wnoncanonical-monad-instances
283 ghc-options: -Wmissed-specialisations
284 -Wall-missed-specialisations
286 if flag(dev) || flag(debug)
287 ghc-options: -fno-ignore-asserts
289common default-extensions
298 ExistentialQuantification
301 GeneralizedNewtypeDeriving
306 MultiParamTypeClasses
315 -- MonoLocalBinds, enabled by TypeFamilies, causes performance
316 -- regressions. Disable it. This must come after TypeFamilies,
317 -- otherwise TypeFamilies will enable it again.
320 -- UndecidableInstances -- Does not show any perf impact
321 -- UnboxedTuples -- interferes with (#.)
323common optimization-options
327 -fspec-constr-recursive=16
330common threading-options
331 ghc-options: -threaded
334-- We need optimization options here to optimize internal (non-inlined)
335-- versions of functions. Also, we have some benchmarking inspection tests
336-- part of the library when built with --benchmarks flag. Thos tests fail
337-- if we do not use optimization options here. It was observed that due to
338-- -O2 here some concurrent/nested benchmarks improved and others regressed.
339-- We can investigate a bit more here why the regression occurred.
341 import: compile-options, optimization-options, default-extensions
343-------------------------------------------------------------------------------
345-------------------------------------------------------------------------------
351 default-extensions: TypeApplications
353 default-extensions: QuantifiedConstraints
355 js-sources: jsbits/clock.js
358 c-sources: src/Streamly/Internal/Data/Time/Windows.c
359 exposed-modules: Streamly.Internal.FileSystem.Event.Windows
360 build-depends: Win32 >= 2.6 && < 2.10
364 include-dirs: src/Streamly/Internal
365 c-sources: src/Streamly/Internal/Data/Time/Darwin.c
366 , src/Streamly/Internal/FileSystem/Event/Darwin.m
368 Streamly.Internal.FileSystem.Event.Darwin
371 exposed-modules: Streamly.Internal.FileSystem.Event.Linux
376 , Streamly.Data.Prim.Array
377 , Streamly.Data.SmallArray
380 , Streamly.Memory.Ring
382 , Streamly.FileSystem.IOVec
383 , Streamly.FileSystem.FDIO
384 , Streamly.FileSystem.FD
390 , Streamly.Data.Unfold
393 , Streamly.Unicode.Stream
396 , Streamly.Data.Array.Storable.Foreign
397 , Streamly.FileSystem.Handle
402 , Streamly.Internal.BaseCompat
403 , Streamly.Internal.Control.Exception
404 , Streamly.Internal.Control.Monad
405 , Streamly.Internal.Data.Cont
406 , Streamly.Internal.Data.Tuple.Strict
407 , Streamly.Internal.Data.Maybe.Strict
408 , Streamly.Internal.Data.Either.Strict
409 , Streamly.Internal.Data.Atomics
410 , Streamly.Internal.Data.Time
411 , Streamly.Internal.Data.Time.TimeSpec
412 , Streamly.Internal.Data.Time.Units
413 , Streamly.Internal.Data.Time.Clock
414 , Streamly.Internal.Data.SVar
417 , Streamly.Internal.Foreign.Malloc
420 , Streamly.Internal.Data.IORef.Prim
423 , Streamly.Internal.Data.Array
424 , Streamly.Internal.Data.Array.Prim.Types
425 , Streamly.Internal.Data.Array.Prim
426 , Streamly.Internal.Data.Array.Prim.Mut.Types
427 , Streamly.Internal.Data.Array.Prim.Pinned.Types
428 , Streamly.Internal.Data.Array.Prim.Pinned
429 , Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types
430 , Streamly.Internal.Data.SmallArray.Types
431 , Streamly.Internal.Data.SmallArray
432 , Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types
433 , Streamly.Internal.Data.Array.Storable.Foreign.Types
434 , Streamly.Internal.Data.Array.Storable.Foreign
435 , Streamly.Internal.Memory.ArrayStream
438 , Streamly.Internal.Data.Fold.Types
439 , Streamly.Internal.Data.Fold
440 , Streamly.Internal.Data.Sink.Types
441 , Streamly.Internal.Data.Sink
444 , Streamly.Internal.Data.Parser.ParserK.Types
445 , Streamly.Internal.Data.Parser.ParserD.Types
446 , Streamly.Internal.Data.Parser.ParserD.Tee
447 , Streamly.Internal.Data.Parser.ParserD
448 , Streamly.Internal.Data.Parser
451 , Streamly.Internal.Data.Stream.StreamK.Type
452 , Streamly.Internal.Data.Stream.StreamK
453 , Streamly.Internal.Data.Stream.StreamD.Type
454 , Streamly.Internal.Data.Stream.StreamD.Generate
455 , Streamly.Internal.Data.Stream.StreamD.Eliminate
456 , Streamly.Internal.Data.Stream.StreamD.Nesting
457 , Streamly.Internal.Data.Stream.StreamD.Transform
458 , Streamly.Internal.Data.Stream.StreamD.Exception
459 , Streamly.Internal.Data.Stream.StreamD.Lift
460 , Streamly.Internal.Data.Stream.StreamD
461 , Streamly.Internal.Data.Stream.StreamDK.Type
462 , Streamly.Internal.Data.Stream.StreamDK
463 , Streamly.Internal.Data.Stream.Enumeration
464 , Streamly.Internal.Data.Stream.Prelude
466 -- Higher level streams
467 , Streamly.Internal.Data.Stream.SVar
468 , Streamly.Internal.Data.Stream.Serial
469 , Streamly.Internal.Data.Stream.Async
470 , Streamly.Internal.Data.Stream.Parallel
471 , Streamly.Internal.Data.Stream.Ahead
472 , Streamly.Internal.Data.Stream.Zip
473 , Streamly.Internal.Data.Stream.Combinators
474 , Streamly.Internal.Data.Stream.IsStream.Common
475 , Streamly.Internal.Data.Stream.IsStream.Generate
476 , Streamly.Internal.Data.Stream.IsStream.Eliminate
477 , Streamly.Internal.Data.Stream.IsStream.Transform
478 , Streamly.Internal.Data.Stream.IsStream.Nesting
479 , Streamly.Internal.Data.Stream.IsStream.Exception
480 , Streamly.Internal.Data.Stream.IsStream.Lift
481 , Streamly.Internal.Data.Stream.IsStream
482 , Streamly.Internal.Data.List
485 , Streamly.Internal.Data.Unfold.Types
486 , Streamly.Internal.Data.Unfold
489 , Streamly.Internal.Data.Pipe.Types
490 , Streamly.Internal.Data.Pipe
493 , Streamly.Internal.FileSystem.Handle
494 , Streamly.Internal.FileSystem.Dir
495 , Streamly.Internal.FileSystem.File
498 , Streamly.Internal.Unicode.Stream
499 , Streamly.Internal.Unicode.Char
500 , Streamly.Internal.Unicode.Array.Char
501 , Streamly.Internal.Unicode.Array.Prim.Pinned
503 -- Serialization/deserialization in binary format
504 , Streamly.Internal.Data.Binary.Decode
507 , Streamly.Data.Unicode.Stream
508 , Streamly.Memory.Array
512 , Streamly.Network.Socket
513 , Streamly.Network.Inet.TCP
515 , Streamly.Internal.Network.Socket
516 , Streamly.Internal.Network.Inet.TCP
519 -- Core libraries shipped with ghc, the min and max
520 -- constraints of these libraries should match with
521 -- the GHC versions we support
523 , containers >= 0.5 && < 0.7
524 , deepseq >= 1.4.1 && < 1.5
525 , directory >= 1.2.2 && < 1.4
526 , exceptions >= 0.8 && < 0.11
527 , ghc-prim >= 0.2 && < 0.7
529 , primitive >= 0.5.4 && < 0.8
530 , transformers >= 0.4 && < 0.6
532 , heaps >= 0.3 && < 0.4
535 , atomic-primops >= 0.8 && < 0.9
536 , lockfree-queue >= 0.2.3 && < 0.3
539 , monad-control >= 1.0 && < 2
540 , transformers-base >= 0.4 && < 0.5
542 , fusion-plugin-types >= 0.1 && < 0.2
545 , network >= 2.6 && < 4
549 build-depends: template-haskell >= 2.14 && < 2.17
550 , inspection-testing >= 0.4 && < 0.5
552 -- Array uses a Storable constraint in dev build making several inspection
554 if flag(dev) && flag(inspection)
555 build-depends: inspection-and-dev-flags-cannot-be-used-together
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