on ede29df help sign in
streamly/streamly.cabal
693 lines 24 kB history raw
1name: streamly
2version: 0.5.2
3synopsis: Beautiful Streaming, Concurrent and Reactive Composition
4description:
5 Streamly, short for streaming concurrently, provides monadic streams, with a
6 simple API, almost identical to standard lists, and an in-built support for
7 concurrency. By using stream-style combinators on stream composition,
8 streams can be generated, merged, chained, mapped, zipped, and consumed
9 concurrently – providing a generalized high level programming framework
10 unifying streaming and concurrency. Controlled concurrency allows even
11 infinite streams to be evaluated concurrently. Concurrency is auto scaled
12 based on feedback from the stream consumer. The programmer does not have to
13 be aware of threads, locking or synchronization to write scalable concurrent
14 programs.
15 .
16 The basic streaming functionality of streamly is equivalent to that provided by
17 streaming libraries like
18 <https://hackage.haskell.org/package/vector vector>,
19 <https://hackage.haskell.org/package/streaming streaming>,
20 <https://hackage.haskell.org/package/pipes pipes>, and
21 <https://hackage.haskell.org/package/conduit conduit>.
22 In addition to providing streaming functionality, streamly subsumes the
23 functionality of list transformer libraries like @pipes@ or
24 <https://hackage.haskell.org/package/list-t list-t> and also the logic
25 programming library <https://hackage.haskell.org/package/logict logict>. On
26 the concurrency side, it subsumes the functionality of the
27 <https://hackage.haskell.org/package/async async> package. Because it
28 supports streaming with concurrency we can write FRP applications similar in
29 concept to <https://hackage.haskell.org/package/Yampa Yampa> or
30 <https://hackage.haskell.org/package/reflex reflex>.
31 .
32 For file IO, currently the library provides only one API to stream the lines
33 in the file as Strings. Future versions will provide better streaming file
34 IO options. Streamly interoperates with the popular streaming libraries, see
35 the interoperation section in "Streamly.Tutorial".
36 .
37 Why use streamly?
38 .
39 * /Simplicity/: Simple list like streaming API, if you know how to use lists
40 then you know how to use streamly. This library is built with simplicity
41 and ease of use as a primary design goal.
42 * /Concurrency/: Simple, powerful, and scalable concurrency. Concurrency is
43 built-in, and not intrusive, concurrent programs are written exactly the
44 same way as non-concurrent ones.
45 * /Generality/: Unifies functionality provided by several disparate packages
46 (streaming, concurrency, list transformer, logic programming, reactive
47 programming) in a concise API.
48 * /Performance/: Streamly is designed for high performance.
49 It employs stream fusion optimizations for best possible performance.
50 Serial peformance is equivalent to the venerable `vector` library in most
51 cases and even better in some cases. Concurrent performance is unbeatable.
52 See
53 <https://github.com/composewell/streaming-benchmarks streaming-benchmarks>
54 for a comparison of popular streaming libraries on micro-benchmarks.
55 .
56 Where to find more information:
57 .
58 * /Quick Overview/: <src/README.md README file> in the package
59 * /Detailed Tutorial/: "Streamly.Tutorial" module in the haddock documentation
60 * /Reference Documentation/: Haddock documentation for the respective modules
61 * /Examples/: <src/examples examples directory> in the package
62 * /Guides/: <src/docs docs directory> in the package, for documentation on
63 advanced topics, limitations, semantics of the library or on specific use
64 cases.
65 * <https://github.com/composewell/streaming-benchmarks Streaming Benchmarks>
66 * <https://github.com/composewell/concurrency-benchmarks Concurrency Benchmarks>
68homepage: https://github.com/composewell/streamly
69bug-reports: https://github.com/composewell/streamly/issues
70license: BSD3
71license-file: LICENSE
72tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3
73author: Harendra Kumar
74maintainer: harendra.kumar@gmail.com
75copyright: 2017 Harendra Kumar
76category: Control, Concurrency, Streaming, Reactivity
77stability: Experimental
78build-type: Simple
79cabal-version: >= 1.10
81extra-source-files:
82 Changelog.md
83 README.md
84 docs/streamly-vs-async.md
85 docs/transformers.md
86 bench.sh
87 stack-7.10.yaml
88 stack-8.0.yaml
89 stack.yaml
90 src/Streamly/Streams/Instances.hs
91 src/Streamly/Streams/inline.hs
93source-repository head
94 type: git
95 location: https://github.com/composewell/streamly
97flag dev
98 description: Development build
99 manual: True
100 default: False
102flag no-fusion
103 description: Disable rewrite rules
104 manual: True
105 default: False
107flag streamk
108 description: Use CPS style streams when possible
109 manual: True
110 default: False
112flag examples
113 description: Build including examples
114 manual: True
115 default: False
117flag examples-sdl
118 description: Build including SDL examples
119 manual: True
120 default: False
122-------------------------------------------------------------------------------
123-- Library
124-------------------------------------------------------------------------------
126library
127 hs-source-dirs: src
128 other-modules: Streamly.SVar
130 -- Base streams
131 , Streamly.Streams.StreamK.Type
132 , Streamly.Streams.StreamK
133 , Streamly.Streams.StreamD.Type
134 , Streamly.Streams.StreamD
135 , Streamly.Streams.Prelude
137 -- Higher level streams
138 , Streamly.Streams.SVar
139 , Streamly.Streams.Serial
140 , Streamly.Streams.Async
141 , Streamly.Streams.Parallel
142 , Streamly.Streams.Ahead
143 , Streamly.Streams.Zip
144 , Streamly.Streams.Combinators
146 exposed-modules: Streamly.Prelude
147 , Streamly.List
148 , Streamly.String
149 , Streamly.Time
150 , Streamly
151 , Streamly.Tutorial
152 , Streamly.Internal
154 default-language: Haskell2010
155 ghc-options: -Wall -fspec-constr-recursive=10
157 if flag(streamk)
158 cpp-options: -DUSE_STREAMK_ONLY
160 if flag(no-fusion)
161 cpp-options: -DDISABLE_FUSION
163 if flag(dev)
164 ghc-options: -Wmissed-specialisations
165 -Wall-missed-specialisations
166 -fno-ignore-asserts
167 if impl(ghc >= 8.0)
168 ghc-options: -Wcompat
169 -Wunrecognised-warning-flags
170 -Widentities
171 -Wincomplete-record-updates
172 -Wincomplete-uni-patterns
173 -Wredundant-constraints
174 -Wnoncanonical-monad-instances
175 -Wnoncanonical-monadfail-instances
177 build-depends: base >= 4.8 && < 5
178 , ghc-prim >= 0.2 && < 0.6
179 , deepseq >= 1.4.3 && < 1.5
180 , containers >= 0.5 && < 0.7
181 , heaps >= 0.3 && < 0.4
183 -- concurrency
184 , atomic-primops >= 0.8 && < 0.9
185 , lockfree-queue >= 0.2.3 && < 0.3
186 , clock >= 0.7.1 && < 0.8
188 -- transfomers
189 , exceptions >= 0.8 && < 0.11
190 , monad-control >= 1.0 && < 2
191 , mtl >= 2.2 && < 3
192 , transformers >= 0.4 && < 0.6
193 , transformers-base >= 0.4 && < 0.5
195 if impl(ghc < 8.0)
196 build-depends:
197 semigroups >= 0.18 && < 0.19
199-------------------------------------------------------------------------------
200-- Test suites
201-------------------------------------------------------------------------------
203-- Compilation for coverage builds on CI machines takes too long without -O0
205test-suite test
206 type: exitcode-stdio-1.0
207 main-is: Main.hs
208 hs-source-dirs: test
209 ghc-options: -O0 -Wall -threaded -with-rtsopts=-N -fno-ignore-asserts
210 if flag(dev)
211 cpp-options: -DDEVBUILD
212 ghc-options: -Wmissed-specialisations
213 -Wall-missed-specialisations
214 if impl(ghc >= 8.0)
215 ghc-options: -Wcompat
216 -Wunrecognised-warning-flags
217 -Widentities
218 -Wincomplete-record-updates
219 -Wincomplete-uni-patterns
220 -Wredundant-constraints
221 -Wnoncanonical-monad-instances
222 -Wnoncanonical-monadfail-instances
223 build-depends:
224 streamly
225 , base >= 4.8 && < 5
226 , hspec >= 2.0 && < 3
227 , containers >= 0.5 && < 0.7
228 , transformers >= 0.4 && < 0.6
229 , mtl >= 2.2 && < 3
230 , exceptions >= 0.8 && < 0.11
231 default-language: Haskell2010
233test-suite pure-streams-base
234 type: exitcode-stdio-1.0
235 main-is: PureStreams.hs
236 hs-source-dirs: test
237 ghc-options: -O0 -Wall -threaded -with-rtsopts=-N -fno-ignore-asserts
238 if flag(dev)
239 cpp-options: -DDEVBUILD
240 ghc-options: -Wmissed-specialisations
241 -Wall-missed-specialisations
242 if impl(ghc >= 8.0)
243 ghc-options: -Wcompat
244 -Wunrecognised-warning-flags
245 -Widentities
246 -Wincomplete-record-updates
247 -Wincomplete-uni-patterns
248 -Wredundant-constraints
249 -Wnoncanonical-monad-instances
250 -Wnoncanonical-monadfail-instances
251 build-depends:
252 streamly
253 , base >= 4.8 && < 5
254 , hspec >= 2.0 && < 3
255 default-language: Haskell2010
257test-suite pure-streams-streamly
258 type: exitcode-stdio-1.0
259 main-is: PureStreams.hs
260 hs-source-dirs: test
261 cpp-options: -DUSE_STREAMLY_LIST
262 ghc-options: -O0 -Wall -threaded -with-rtsopts=-N -fno-ignore-asserts
263 if flag(dev)
264 cpp-options: -DDEVBUILD
265 ghc-options: -Wmissed-specialisations
266 -Wall-missed-specialisations
267 if impl(ghc >= 8.0)
268 ghc-options: -Wcompat
269 -Wunrecognised-warning-flags
270 -Widentities
271 -Wincomplete-record-updates
272 -Wincomplete-uni-patterns
273 -Wredundant-constraints
274 -Wnoncanonical-monad-instances
275 -Wnoncanonical-monadfail-instances
276 build-depends:
277 streamly
278 , base >= 4.8 && < 5
279 , hspec >= 2.0 && < 3
280 default-language: Haskell2010
282test-suite properties
283 type: exitcode-stdio-1.0
284 main-is: Prop.hs
285 hs-source-dirs: test
286 ghc-options: -fno-ignore-asserts -Wall -O0 -threaded -with-rtsopts=-N
287 if flag(dev)
288 cpp-options: -DDEVBUILD
289 ghc-options: -Wmissed-specialisations
290 -Wall-missed-specialisations
291 if impl(ghc >= 8.0)
292 ghc-options: -Wcompat
293 -Wunrecognised-warning-flags
294 -Widentities
295 -Wincomplete-record-updates
296 -Wincomplete-uni-patterns
297 -Wredundant-constraints
298 -Wnoncanonical-monad-instances
299 -Wnoncanonical-monadfail-instances
300 build-depends:
301 streamly
302 , base >= 4.8 && < 5
303 , QuickCheck >= 2.10 && < 2.13
304 , hspec >= 2.0 && < 3
305 if impl(ghc < 8.0)
306 build-depends:
307 transformers >= 0.4 && < 0.6
308 default-language: Haskell2010
310test-suite maxrate
311 type: exitcode-stdio-1.0
312 default-language: Haskell2010
313 main-is: MaxRate.hs
314 hs-source-dirs: test
315 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
316 if flag(dev)
317 buildable: True
318 build-Depends:
319 streamly
320 , base >= 4.8 && < 5
321 , clock >= 0.7.1 && < 0.8
322 , hspec >= 2.0 && < 3
323 , random >= 1.0.0 && < 2
324 else
325 buildable: False
327test-suite loops
328 type: exitcode-stdio-1.0
329 default-language: Haskell2010
330 main-is: loops.hs
331 hs-source-dirs: test
332 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
333 build-Depends:
334 streamly
335 , base >= 4.8 && < 5
337test-suite nested-loops
338 type: exitcode-stdio-1.0
339 default-language: Haskell2010
340 main-is: nested-loops.hs
341 hs-source-dirs: test
342 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
343 build-Depends:
344 streamly
345 , base >= 4.8 && < 5
346 , random >= 1.0.0 && < 2
348test-suite parallel-loops
349 type: exitcode-stdio-1.0
350 default-language: Haskell2010
351 main-is: parallel-loops.hs
352 hs-source-dirs: test
353 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
354 build-Depends:
355 streamly
356 , base >= 4.8 && < 5
357 , random >= 1.0.0 && < 2
359-------------------------------------------------------------------------------
360-- Benchmarks
361-------------------------------------------------------------------------------
363benchmark linear
364 type: exitcode-stdio-1.0
365 hs-source-dirs: benchmark
366 main-is: Linear.hs
367 other-modules: LinearOps
368 default-language: Haskell2010
369 ghc-options: -O2 -Wall -fspec-constr-recursive=10
370 if flag(dev)
371 ghc-options: -Wmissed-specialisations
372 -Wall-missed-specialisations
373 -fno-ignore-asserts
374 if impl(ghc >= 8.0)
375 ghc-options: -Wcompat
376 -Wunrecognised-warning-flags
377 -Widentities
378 -Wincomplete-record-updates
379 -Wincomplete-uni-patterns
380 -Wredundant-constraints
381 -Wnoncanonical-monad-instances
382 -Wnoncanonical-monadfail-instances
383 build-depends:
384 streamly
385 , base >= 4.8 && < 5
386 , deepseq >= 1.4.3 && < 1.5
387 , random >= 1.0 && < 2.0
388 , gauge >= 0.2.4 && < 0.3
390benchmark linear-async
391 type: exitcode-stdio-1.0
392 hs-source-dirs: benchmark
393 main-is: LinearAsync.hs
394 other-modules: LinearOps
395 default-language: Haskell2010
396 ghc-options: -O2 -Wall -fspec-constr-recursive=10
397 cpp-options: -DLINEAR_ASYNC
398 if flag(dev)
399 ghc-options: -Wmissed-specialisations
400 -Wall-missed-specialisations
401 -fno-ignore-asserts
402 if impl(ghc >= 8.0)
403 ghc-options: -Wcompat
404 -Wunrecognised-warning-flags
405 -Widentities
406 -Wincomplete-record-updates
407 -Wincomplete-uni-patterns
408 -Wredundant-constraints
409 -Wnoncanonical-monad-instances
410 -Wnoncanonical-monadfail-instances
411 build-depends:
412 streamly
413 , base >= 4.8 && < 5
414 , deepseq >= 1.4.3 && < 1.5
415 , random >= 1.0 && < 2.0
416 , gauge >= 0.2.4 && < 0.3
418benchmark linear-rate
419 type: exitcode-stdio-1.0
420 hs-source-dirs: benchmark
421 main-is: LinearRate.hs
422 other-modules: LinearOps
423 default-language: Haskell2010
424 ghc-options: -O2 -Wall -fspec-constr-recursive=10
425 if flag(dev)
426 ghc-options: -Wmissed-specialisations
427 -Wall-missed-specialisations
428 -fno-ignore-asserts
429 if impl(ghc >= 8.0)
430 ghc-options: -Wcompat
431 -Wunrecognised-warning-flags
432 -Widentities
433 -Wincomplete-record-updates
434 -Wincomplete-uni-patterns
435 -Wredundant-constraints
436 -Wnoncanonical-monad-instances
437 -Wnoncanonical-monadfail-instances
438 build-depends:
439 streamly
440 , base >= 4.8 && < 5
441 , deepseq >= 1.4.3 && < 1.5
442 , random >= 1.0 && < 2.0
443 , gauge >= 0.2.4 && < 0.3
445benchmark nested
446 type: exitcode-stdio-1.0
447 hs-source-dirs: benchmark
448 main-is: Nested.hs
449 other-modules: NestedOps
450 default-language: Haskell2010
451 ghc-options: -O2 -Wall -fspec-constr-recursive=10
452 if flag(dev)
453 ghc-options: -Wmissed-specialisations
454 -Wall-missed-specialisations
455 -fno-ignore-asserts
456 if impl(ghc >= 8.0)
457 ghc-options: -Wcompat
458 -Wunrecognised-warning-flags
459 -Widentities
460 -Wincomplete-record-updates
461 -Wincomplete-uni-patterns
462 -Wredundant-constraints
463 -Wnoncanonical-monad-instances
464 -Wnoncanonical-monadfail-instances
465 build-depends:
466 streamly
467 , base >= 4.8 && < 5
468 , deepseq >= 1.4.3 && < 1.5
469 , random >= 1.0 && < 2.0
470 , gauge >= 0.2.4 && < 0.3
472-------------------------------------------------------------------------------
473-- Internal benchmarks for unexposed modules
474-------------------------------------------------------------------------------
476-- We have to copy the streamly library modules here because there is no
477-- way to use unexposed modules from the library.
479benchmark base
480 type: exitcode-stdio-1.0
481 hs-source-dirs: benchmark, src
482 main-is: BaseStreams.hs
483 other-modules: Streamly.SVar
484 , Streamly.Streams.StreamK.Type
485 , Streamly.Streams.StreamK
486 , Streamly.Streams.StreamD.Type
487 , Streamly.Streams.StreamD
488 , Streamly.Streams.Prelude
490 , StreamDOps
491 , StreamKOps
493 default-language: Haskell2010
494 ghc-options: -O2 -Wall -fspec-constr-recursive=10
495 if flag(dev)
496 ghc-options: -Wmissed-specialisations
497 -Wall-missed-specialisations
498 -fno-ignore-asserts
499 if impl(ghc >= 8.0)
500 ghc-options: -Wcompat
501 -Wunrecognised-warning-flags
502 -Widentities
503 -Wincomplete-record-updates
504 -Wincomplete-uni-patterns
505 -Wredundant-constraints
506 -Wnoncanonical-monad-instances
507 -Wnoncanonical-monadfail-instances
509 if flag(dev)
510 buildable: True
511 build-depends:
512 base >= 4.8 && < 5
513 , deepseq >= 1.4.3 && < 1.5
514 , random >= 1.0 && < 2.0
515 , gauge >= 0.2.4 && < 0.3
517 , ghc-prim >= 0.2 && < 0.6
518 , containers >= 0.5 && < 0.7
519 , heaps >= 0.3 && < 0.4
521 -- concurrency
522 , atomic-primops >= 0.8 && < 0.9
523 , lockfree-queue >= 0.2.3 && < 0.3
524 , clock >= 0.7.1 && < 0.8
526 , exceptions >= 0.8 && < 0.11
527 , monad-control >= 1.0 && < 2
528 , mtl >= 2.2 && < 3
529 , transformers >= 0.4 && < 0.6
530 , transformers-base >= 0.4 && < 0.5
532 if impl(ghc < 8.0)
533 build-depends:
534 semigroups >= 0.18 && < 0.19
535 else
536 buildable: False
538executable nano-bench
539 hs-source-dirs: benchmark, src
540 main-is: NanoBenchmarks.hs
541 other-modules: Streamly.SVar
542 , Streamly.Streams.StreamK.Type
543 , Streamly.Streams.StreamK
544 , Streamly.Streams.StreamD.Type
545 , Streamly.Streams.StreamD
546 default-language: Haskell2010
547 ghc-options: -O2 -Wall
549 if flag(dev)
550 buildable: True
551 build-depends:
552 base >= 4.8 && < 5
553 , gauge >= 0.2.4 && < 0.3
554 , ghc-prim >= 0.2 && < 0.6
555 , containers >= 0.5 && < 0.7
556 , heaps >= 0.3 && < 0.4
557 , random >= 1.0 && < 2.0
559 -- concurrency
560 , atomic-primops >= 0.8 && < 0.9
561 , lockfree-queue >= 0.2.3 && < 0.3
562 , clock >= 0.7.1 && < 0.8
564 , exceptions >= 0.8 && < 0.11
565 , monad-control >= 1.0 && < 2
566 , mtl >= 2.2 && < 3
567 , transformers >= 0.4 && < 0.6
568 else
569 buildable: False
571executable adaptive
572 hs-source-dirs: benchmark
573 main-is: Adaptive.hs
574 default-language: Haskell2010
575 ghc-options: -O2 -Wall
577 if flag(dev)
578 buildable: True
579 build-depends:
580 streamly
581 , base >= 4.8 && < 5
582 , gauge >= 0.2.4 && < 0.3
583 , random >= 1.0 && < 2.0
584 else
585 buildable: False
587executable chart
588 default-language: Haskell2010
589 hs-source-dirs: benchmark
590 main-is: Chart.hs
591 if flag(dev)
592 buildable: True
593 build-Depends:
594 base >= 4.8 && < 5
595 , bench-show >= 0.2 && < 0.3
596 , split
597 , transformers >= 0.4 && < 0.6
598 else
599 buildable: False
601-------------------------------------------------------------------------------
602-- Examples
603-------------------------------------------------------------------------------
605executable SearchQuery
606 default-language: Haskell2010
607 main-is: SearchQuery.hs
608 hs-source-dirs: examples
609 if flag(examples) || flag(examples-sdl)
610 buildable: True
611 build-Depends:
612 streamly
613 , base >= 4.8 && < 5
614 , http-conduit >= 2.2.2 && < 2.4
615 else
616 buildable: False
618executable ListDir
619 default-language: Haskell2010
620 main-is: ListDir.hs
621 hs-source-dirs: examples
622 if flag(examples) || flag(examples-sdl)
623 buildable: True
624 build-Depends:
625 streamly
626 , base >= 4.8 && < 5
627 , path-io >= 0.1.0 && < 1.4
628 if impl(ghc < 8.0)
629 build-depends:
630 transformers >= 0.4 && < 0.6
631 else
632 buildable: False
634executable MergeSort
635 default-language: Haskell2010
636 main-is: MergeSort.hs
637 hs-source-dirs: examples
638 if flag(examples) || flag(examples-sdl)
639 buildable: True
640 build-Depends:
641 streamly
642 , base >= 4.8 && < 5
643 , random >= 1.0.0 && < 2
644 else
645 buildable: False
647executable AcidRain
648 default-language: Haskell2010
649 main-is: AcidRain.hs
650 hs-source-dirs: examples
651 if flag(examples) || flag(examples-sdl)
652 buildable: True
653 build-Depends:
654 streamly
655 , base >= 4.8 && < 5
656 , mtl >= 2.2 && < 3
657 if impl(ghc < 8.0)
658 build-depends:
659 semigroups >= 0.18 && < 0.19
660 , transformers >= 0.4 && < 0.6
661 else
662 buildable: False
664executable CirclingSquare
665 default-language: Haskell2010
666 main-is: CirclingSquare.hs
667 hs-source-dirs: examples
668 if flag(examples-sdl)
669 buildable: True
670 build-Depends:
671 streamly
672 , base >= 4.8 && < 5
673 , SDL >= 0.6.5 && < 0.7
674 else
675 buildable: False
677executable ControlFlow
678 default-language: Haskell2010
679 main-is: ControlFlow.hs
680 hs-source-dirs: examples
681 if flag(examples) || flag(examples-sdl)
682 buildable: True
683 build-Depends:
684 streamly
685 , base >= 4.8 && < 5
686 , exceptions >= 0.8 && < 0.11
687 , transformers >= 0.4 && < 0.6
688 , transformers-base >= 0.4 && < 0.5
689 if impl(ghc < 8.0)
690 build-depends:
691 semigroups >= 0.18 && < 0.19
692 else
693 buildable: False