on 57fad21 help sign in
streamly/streamly.cabal
688 lines 23 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
485 , Streamly.Streams.StreamD
486 , Streamly.Streams.Prelude
488 , StreamDOps
489 , StreamKOps
491 default-language: Haskell2010
492 ghc-options: -O2 -Wall -fspec-constr-recursive=10
493 if flag(dev)
494 ghc-options: -Wmissed-specialisations
495 -Wall-missed-specialisations
496 -fno-ignore-asserts
497 if impl(ghc >= 8.0)
498 ghc-options: -Wcompat
499 -Wunrecognised-warning-flags
500 -Widentities
501 -Wincomplete-record-updates
502 -Wincomplete-uni-patterns
503 -Wredundant-constraints
504 -Wnoncanonical-monad-instances
505 -Wnoncanonical-monadfail-instances
507 if flag(dev)
508 buildable: True
509 build-depends:
510 base >= 4.8 && < 5
511 , deepseq >= 1.4.3 && < 1.5
512 , random >= 1.0 && < 2.0
513 , gauge >= 0.2.4 && < 0.3
515 , ghc-prim >= 0.2 && < 0.6
516 , containers >= 0.5 && < 0.7
517 , heaps >= 0.3 && < 0.4
519 -- concurrency
520 , atomic-primops >= 0.8 && < 0.9
521 , lockfree-queue >= 0.2.3 && < 0.3
522 , clock >= 0.7.1 && < 0.8
524 , exceptions >= 0.8 && < 0.11
525 , monad-control >= 1.0 && < 2
526 , mtl >= 2.2 && < 3
527 , transformers >= 0.4 && < 0.6
528 , transformers-base >= 0.4 && < 0.5
530 if impl(ghc < 8.0)
531 build-depends:
532 semigroups >= 0.18 && < 0.19
533 else
534 buildable: False
536executable nano-bench
537 hs-source-dirs: benchmark, src
538 main-is: NanoBenchmarks.hs
539 other-modules: Streamly.SVar
540 , Streamly.Streams.StreamK
541 , Streamly.Streams.StreamD
542 default-language: Haskell2010
543 ghc-options: -O2 -Wall
545 if flag(dev)
546 buildable: True
547 build-depends:
548 base >= 4.8 && < 5
549 , gauge >= 0.2.4 && < 0.3
550 , ghc-prim >= 0.2 && < 0.6
551 , containers >= 0.5 && < 0.7
552 , heaps >= 0.3 && < 0.4
554 -- concurrency
555 , atomic-primops >= 0.8 && < 0.9
556 , lockfree-queue >= 0.2.3 && < 0.3
557 , clock >= 0.7.1 && < 0.8
559 , exceptions >= 0.8 && < 0.11
560 , monad-control >= 1.0 && < 2
561 , mtl >= 2.2 && < 3
562 , transformers >= 0.4 && < 0.6
563 else
564 buildable: False
566executable adaptive
567 hs-source-dirs: benchmark
568 main-is: Adaptive.hs
569 default-language: Haskell2010
570 ghc-options: -O2 -Wall
572 if flag(dev)
573 buildable: True
574 build-depends:
575 streamly
576 , base >= 4.8 && < 5
577 , gauge >= 0.2.4 && < 0.3
578 , random >= 1.0 && < 2.0
579 else
580 buildable: False
582executable chart
583 default-language: Haskell2010
584 hs-source-dirs: benchmark
585 main-is: Chart.hs
586 if flag(dev)
587 buildable: True
588 build-Depends:
589 base >= 4.8 && < 5
590 , bench-show >= 0.2 && < 0.3
591 , split
592 , transformers >= 0.4 && < 0.6
593 else
594 buildable: False
596-------------------------------------------------------------------------------
597-- Examples
598-------------------------------------------------------------------------------
600executable SearchQuery
601 default-language: Haskell2010
602 main-is: SearchQuery.hs
603 hs-source-dirs: examples
604 if flag(examples) || flag(examples-sdl)
605 buildable: True
606 build-Depends:
607 streamly
608 , base >= 4.8 && < 5
609 , http-conduit >= 2.2.2 && < 2.4
610 else
611 buildable: False
613executable ListDir
614 default-language: Haskell2010
615 main-is: ListDir.hs
616 hs-source-dirs: examples
617 if flag(examples) || flag(examples-sdl)
618 buildable: True
619 build-Depends:
620 streamly
621 , base >= 4.8 && < 5
622 , path-io >= 0.1.0 && < 1.4
623 if impl(ghc < 8.0)
624 build-depends:
625 transformers >= 0.4 && < 0.6
626 else
627 buildable: False
629executable MergeSort
630 default-language: Haskell2010
631 main-is: MergeSort.hs
632 hs-source-dirs: examples
633 if flag(examples) || flag(examples-sdl)
634 buildable: True
635 build-Depends:
636 streamly
637 , base >= 4.8 && < 5
638 , random >= 1.0.0 && < 2
639 else
640 buildable: False
642executable AcidRain
643 default-language: Haskell2010
644 main-is: AcidRain.hs
645 hs-source-dirs: examples
646 if flag(examples) || flag(examples-sdl)
647 buildable: True
648 build-Depends:
649 streamly
650 , base >= 4.8 && < 5
651 , mtl >= 2.2 && < 3
652 if impl(ghc < 8.0)
653 build-depends:
654 semigroups >= 0.18 && < 0.19
655 , transformers >= 0.4 && < 0.6
656 else
657 buildable: False
659executable CirclingSquare
660 default-language: Haskell2010
661 main-is: CirclingSquare.hs
662 hs-source-dirs: examples
663 if flag(examples-sdl)
664 buildable: True
665 build-Depends:
666 streamly
667 , base >= 4.8 && < 5
668 , SDL >= 0.6.5 && < 0.7
669 else
670 buildable: False
672executable ControlFlow
673 default-language: Haskell2010
674 main-is: ControlFlow.hs
675 hs-source-dirs: examples
676 if flag(examples) || flag(examples-sdl)
677 buildable: True
678 build-Depends:
679 streamly
680 , base >= 4.8 && < 5
681 , exceptions >= 0.8 && < 0.11
682 , transformers >= 0.4 && < 0.6
683 , transformers-base >= 0.4 && < 0.5
684 if impl(ghc < 8.0)
685 build-depends:
686 semigroups >= 0.18 && < 0.19
687 else
688 buildable: False