on e08ff86 help sign in
streamly/streamly.cabal
687 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
132 , Streamly.Streams.StreamDType
133 , Streamly.Streams.StreamD
134 , Streamly.Streams.Prelude
136 -- Higher level streams
137 , Streamly.Streams.SVar
138 , Streamly.Streams.Serial
139 , Streamly.Streams.Async
140 , Streamly.Streams.Parallel
141 , Streamly.Streams.Ahead
142 , Streamly.Streams.Zip
143 , Streamly.Streams.Combinators
145 exposed-modules: Streamly.Prelude
146 , Streamly.List
147 , Streamly.String
148 , Streamly.Time
149 , Streamly
150 , Streamly.Tutorial
151 , Streamly.Internal
153 default-language: Haskell2010
154 ghc-options: -Wall -fspec-constr-recursive=10
156 if flag(streamk)
157 cpp-options: -DUSE_STREAMK_ONLY
159 if flag(no-fusion)
160 cpp-options: -DDISABLE_FUSION
162 if flag(dev)
163 ghc-options: -Wmissed-specialisations
164 -Wall-missed-specialisations
165 -fno-ignore-asserts
166 if impl(ghc >= 8.0)
167 ghc-options: -Wcompat
168 -Wunrecognised-warning-flags
169 -Widentities
170 -Wincomplete-record-updates
171 -Wincomplete-uni-patterns
172 -Wredundant-constraints
173 -Wnoncanonical-monad-instances
174 -Wnoncanonical-monadfail-instances
176 build-depends: base >= 4.8 && < 5
177 , ghc-prim >= 0.2 && < 0.6
178 , deepseq >= 1.4.3 && < 1.5
179 , containers >= 0.5 && < 0.7
180 , heaps >= 0.3 && < 0.4
182 -- concurrency
183 , atomic-primops >= 0.8 && < 0.9
184 , lockfree-queue >= 0.2.3 && < 0.3
185 , clock >= 0.7.1 && < 0.8
187 -- transfomers
188 , exceptions >= 0.8 && < 0.11
189 , monad-control >= 1.0 && < 2
190 , mtl >= 2.2 && < 3
191 , transformers >= 0.4 && < 0.6
192 , transformers-base >= 0.4 && < 0.5
194 if impl(ghc < 8.0)
195 build-depends:
196 semigroups >= 0.18 && < 0.19
198-------------------------------------------------------------------------------
199-- Test suites
200-------------------------------------------------------------------------------
202-- Compilation for coverage builds on CI machines takes too long without -O0
204test-suite test
205 type: exitcode-stdio-1.0
206 main-is: Main.hs
207 hs-source-dirs: test
208 ghc-options: -O0 -Wall -threaded -with-rtsopts=-N -fno-ignore-asserts
209 if flag(dev)
210 cpp-options: -DDEVBUILD
211 ghc-options: -Wmissed-specialisations
212 -Wall-missed-specialisations
213 if impl(ghc >= 8.0)
214 ghc-options: -Wcompat
215 -Wunrecognised-warning-flags
216 -Widentities
217 -Wincomplete-record-updates
218 -Wincomplete-uni-patterns
219 -Wredundant-constraints
220 -Wnoncanonical-monad-instances
221 -Wnoncanonical-monadfail-instances
222 build-depends:
223 streamly
224 , base >= 4.8 && < 5
225 , hspec >= 2.0 && < 3
226 , containers >= 0.5 && < 0.7
227 , transformers >= 0.4 && < 0.6
228 , mtl >= 2.2 && < 3
229 , exceptions >= 0.8 && < 0.11
230 default-language: Haskell2010
232test-suite pure-streams-base
233 type: exitcode-stdio-1.0
234 main-is: PureStreams.hs
235 hs-source-dirs: test
236 ghc-options: -O0 -Wall -threaded -with-rtsopts=-N -fno-ignore-asserts
237 if flag(dev)
238 cpp-options: -DDEVBUILD
239 ghc-options: -Wmissed-specialisations
240 -Wall-missed-specialisations
241 if impl(ghc >= 8.0)
242 ghc-options: -Wcompat
243 -Wunrecognised-warning-flags
244 -Widentities
245 -Wincomplete-record-updates
246 -Wincomplete-uni-patterns
247 -Wredundant-constraints
248 -Wnoncanonical-monad-instances
249 -Wnoncanonical-monadfail-instances
250 build-depends:
251 streamly
252 , base >= 4.8 && < 5
253 , hspec >= 2.0 && < 3
254 default-language: Haskell2010
256test-suite pure-streams-streamly
257 type: exitcode-stdio-1.0
258 main-is: PureStreams.hs
259 hs-source-dirs: test
260 cpp-options: -DUSE_STREAMLY_LIST
261 ghc-options: -O0 -Wall -threaded -with-rtsopts=-N -fno-ignore-asserts
262 if flag(dev)
263 cpp-options: -DDEVBUILD
264 ghc-options: -Wmissed-specialisations
265 -Wall-missed-specialisations
266 if impl(ghc >= 8.0)
267 ghc-options: -Wcompat
268 -Wunrecognised-warning-flags
269 -Widentities
270 -Wincomplete-record-updates
271 -Wincomplete-uni-patterns
272 -Wredundant-constraints
273 -Wnoncanonical-monad-instances
274 -Wnoncanonical-monadfail-instances
275 build-depends:
276 streamly
277 , base >= 4.8 && < 5
278 , hspec >= 2.0 && < 3
279 default-language: Haskell2010
281test-suite properties
282 type: exitcode-stdio-1.0
283 main-is: Prop.hs
284 hs-source-dirs: test
285 ghc-options: -fno-ignore-asserts -Wall -O0 -threaded -with-rtsopts=-N
286 if flag(dev)
287 cpp-options: -DDEVBUILD
288 ghc-options: -Wmissed-specialisations
289 -Wall-missed-specialisations
290 if impl(ghc >= 8.0)
291 ghc-options: -Wcompat
292 -Wunrecognised-warning-flags
293 -Widentities
294 -Wincomplete-record-updates
295 -Wincomplete-uni-patterns
296 -Wredundant-constraints
297 -Wnoncanonical-monad-instances
298 -Wnoncanonical-monadfail-instances
299 build-depends:
300 streamly
301 , base >= 4.8 && < 5
302 , QuickCheck >= 2.10 && < 2.13
303 , hspec >= 2.0 && < 3
304 if impl(ghc < 8.0)
305 build-depends:
306 transformers >= 0.4 && < 0.6
307 default-language: Haskell2010
309test-suite maxrate
310 type: exitcode-stdio-1.0
311 default-language: Haskell2010
312 main-is: MaxRate.hs
313 hs-source-dirs: test
314 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
315 if flag(dev)
316 buildable: True
317 build-Depends:
318 streamly
319 , base >= 4.8 && < 5
320 , clock >= 0.7.1 && < 0.8
321 , hspec >= 2.0 && < 3
322 , random >= 1.0.0 && < 2
323 else
324 buildable: False
326test-suite loops
327 type: exitcode-stdio-1.0
328 default-language: Haskell2010
329 main-is: loops.hs
330 hs-source-dirs: test
331 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
332 build-Depends:
333 streamly
334 , base >= 4.8 && < 5
336test-suite nested-loops
337 type: exitcode-stdio-1.0
338 default-language: Haskell2010
339 main-is: nested-loops.hs
340 hs-source-dirs: test
341 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
342 build-Depends:
343 streamly
344 , base >= 4.8 && < 5
345 , random >= 1.0.0 && < 2
347test-suite parallel-loops
348 type: exitcode-stdio-1.0
349 default-language: Haskell2010
350 main-is: parallel-loops.hs
351 hs-source-dirs: test
352 ghc-options: -fno-ignore-asserts -O2 -Wall -threaded -with-rtsopts=-N
353 build-Depends:
354 streamly
355 , base >= 4.8 && < 5
356 , random >= 1.0.0 && < 2
358-------------------------------------------------------------------------------
359-- Benchmarks
360-------------------------------------------------------------------------------
362benchmark linear
363 type: exitcode-stdio-1.0
364 hs-source-dirs: benchmark
365 main-is: Linear.hs
366 other-modules: LinearOps
367 default-language: Haskell2010
368 ghc-options: -O2 -Wall -fspec-constr-recursive=10
369 if flag(dev)
370 ghc-options: -Wmissed-specialisations
371 -Wall-missed-specialisations
372 -fno-ignore-asserts
373 if impl(ghc >= 8.0)
374 ghc-options: -Wcompat
375 -Wunrecognised-warning-flags
376 -Widentities
377 -Wincomplete-record-updates
378 -Wincomplete-uni-patterns
379 -Wredundant-constraints
380 -Wnoncanonical-monad-instances
381 -Wnoncanonical-monadfail-instances
382 build-depends:
383 streamly
384 , base >= 4.8 && < 5
385 , deepseq >= 1.4.3 && < 1.5
386 , random >= 1.0 && < 2.0
387 , gauge >= 0.2.4 && < 0.3
389benchmark linear-async
390 type: exitcode-stdio-1.0
391 hs-source-dirs: benchmark
392 main-is: LinearAsync.hs
393 other-modules: LinearOps
394 default-language: Haskell2010
395 ghc-options: -O2 -Wall -fspec-constr-recursive=10
396 cpp-options: -DLINEAR_ASYNC
397 if flag(dev)
398 ghc-options: -Wmissed-specialisations
399 -Wall-missed-specialisations
400 -fno-ignore-asserts
401 if impl(ghc >= 8.0)
402 ghc-options: -Wcompat
403 -Wunrecognised-warning-flags
404 -Widentities
405 -Wincomplete-record-updates
406 -Wincomplete-uni-patterns
407 -Wredundant-constraints
408 -Wnoncanonical-monad-instances
409 -Wnoncanonical-monadfail-instances
410 build-depends:
411 streamly
412 , base >= 4.8 && < 5
413 , deepseq >= 1.4.3 && < 1.5
414 , random >= 1.0 && < 2.0
415 , gauge >= 0.2.4 && < 0.3
417benchmark linear-rate
418 type: exitcode-stdio-1.0
419 hs-source-dirs: benchmark
420 main-is: LinearRate.hs
421 other-modules: LinearOps
422 default-language: Haskell2010
423 ghc-options: -O2 -Wall -fspec-constr-recursive=10
424 if flag(dev)
425 ghc-options: -Wmissed-specialisations
426 -Wall-missed-specialisations
427 -fno-ignore-asserts
428 if impl(ghc >= 8.0)
429 ghc-options: -Wcompat
430 -Wunrecognised-warning-flags
431 -Widentities
432 -Wincomplete-record-updates
433 -Wincomplete-uni-patterns
434 -Wredundant-constraints
435 -Wnoncanonical-monad-instances
436 -Wnoncanonical-monadfail-instances
437 build-depends:
438 streamly
439 , base >= 4.8 && < 5
440 , deepseq >= 1.4.3 && < 1.5
441 , random >= 1.0 && < 2.0
442 , gauge >= 0.2.4 && < 0.3
444benchmark nested
445 type: exitcode-stdio-1.0
446 hs-source-dirs: benchmark
447 main-is: Nested.hs
448 other-modules: NestedOps
449 default-language: Haskell2010
450 ghc-options: -O2 -Wall -fspec-constr-recursive=10
451 if flag(dev)
452 ghc-options: -Wmissed-specialisations
453 -Wall-missed-specialisations
454 -fno-ignore-asserts
455 if impl(ghc >= 8.0)
456 ghc-options: -Wcompat
457 -Wunrecognised-warning-flags
458 -Widentities
459 -Wincomplete-record-updates
460 -Wincomplete-uni-patterns
461 -Wredundant-constraints
462 -Wnoncanonical-monad-instances
463 -Wnoncanonical-monadfail-instances
464 build-depends:
465 streamly
466 , base >= 4.8 && < 5
467 , deepseq >= 1.4.3 && < 1.5
468 , random >= 1.0 && < 2.0
469 , gauge >= 0.2.4 && < 0.3
471-------------------------------------------------------------------------------
472-- Internal benchmarks for unexposed modules
473-------------------------------------------------------------------------------
475-- We have to copy the streamly library modules here because there is no
476-- way to use unexposed modules from the library.
478benchmark base
479 type: exitcode-stdio-1.0
480 hs-source-dirs: benchmark, src
481 main-is: BaseStreams.hs
482 other-modules: Streamly.SVar
483 , Streamly.Streams.StreamK
484 , Streamly.Streams.StreamD
485 , Streamly.Streams.Prelude
487 , StreamDOps
488 , StreamKOps
490 default-language: Haskell2010
491 ghc-options: -O2 -Wall -fspec-constr-recursive=10
492 if flag(dev)
493 ghc-options: -Wmissed-specialisations
494 -Wall-missed-specialisations
495 -fno-ignore-asserts
496 if impl(ghc >= 8.0)
497 ghc-options: -Wcompat
498 -Wunrecognised-warning-flags
499 -Widentities
500 -Wincomplete-record-updates
501 -Wincomplete-uni-patterns
502 -Wredundant-constraints
503 -Wnoncanonical-monad-instances
504 -Wnoncanonical-monadfail-instances
506 if flag(dev)
507 buildable: True
508 build-depends:
509 base >= 4.8 && < 5
510 , deepseq >= 1.4.3 && < 1.5
511 , random >= 1.0 && < 2.0
512 , gauge >= 0.2.4 && < 0.3
514 , ghc-prim >= 0.2 && < 0.6
515 , containers >= 0.5 && < 0.7
516 , heaps >= 0.3 && < 0.4
518 -- concurrency
519 , atomic-primops >= 0.8 && < 0.9
520 , lockfree-queue >= 0.2.3 && < 0.3
521 , clock >= 0.7.1 && < 0.8
523 , exceptions >= 0.8 && < 0.11
524 , monad-control >= 1.0 && < 2
525 , mtl >= 2.2 && < 3
526 , transformers >= 0.4 && < 0.6
527 , transformers-base >= 0.4 && < 0.5
529 if impl(ghc < 8.0)
530 build-depends:
531 semigroups >= 0.18 && < 0.19
532 else
533 buildable: False
535executable nano-bench
536 hs-source-dirs: benchmark, src
537 main-is: NanoBenchmarks.hs
538 other-modules: Streamly.SVar
539 , Streamly.Streams.StreamK
540 , Streamly.Streams.StreamD
541 default-language: Haskell2010
542 ghc-options: -O2 -Wall
544 if flag(dev)
545 buildable: True
546 build-depends:
547 base >= 4.8 && < 5
548 , gauge >= 0.2.4 && < 0.3
549 , ghc-prim >= 0.2 && < 0.6
550 , containers >= 0.5 && < 0.7
551 , heaps >= 0.3 && < 0.4
553 -- concurrency
554 , atomic-primops >= 0.8 && < 0.9
555 , lockfree-queue >= 0.2.3 && < 0.3
556 , clock >= 0.7.1 && < 0.8
558 , exceptions >= 0.8 && < 0.11
559 , monad-control >= 1.0 && < 2
560 , mtl >= 2.2 && < 3
561 , transformers >= 0.4 && < 0.6
562 else
563 buildable: False
565executable adaptive
566 hs-source-dirs: benchmark
567 main-is: Adaptive.hs
568 default-language: Haskell2010
569 ghc-options: -O2 -Wall
571 if flag(dev)
572 buildable: True
573 build-depends:
574 streamly
575 , base >= 4.8 && < 5
576 , gauge >= 0.2.4 && < 0.3
577 , random >= 1.0 && < 2.0
578 else
579 buildable: False
581executable chart
582 default-language: Haskell2010
583 hs-source-dirs: benchmark
584 main-is: Chart.hs
585 if flag(dev)
586 buildable: True
587 build-Depends:
588 base >= 4.8 && < 5
589 , bench-show >= 0.2 && < 0.3
590 , split
591 , transformers >= 0.4 && < 0.6
592 else
593 buildable: False
595-------------------------------------------------------------------------------
596-- Examples
597-------------------------------------------------------------------------------
599executable SearchQuery
600 default-language: Haskell2010
601 main-is: SearchQuery.hs
602 hs-source-dirs: examples
603 if flag(examples) || flag(examples-sdl)
604 buildable: True
605 build-Depends:
606 streamly
607 , base >= 4.8 && < 5
608 , http-conduit >= 2.2.2 && < 2.4
609 else
610 buildable: False
612executable ListDir
613 default-language: Haskell2010
614 main-is: ListDir.hs
615 hs-source-dirs: examples
616 if flag(examples) || flag(examples-sdl)
617 buildable: True
618 build-Depends:
619 streamly
620 , base >= 4.8 && < 5
621 , path-io >= 0.1.0 && < 1.4
622 if impl(ghc < 8.0)
623 build-depends:
624 transformers >= 0.4 && < 0.6
625 else
626 buildable: False
628executable MergeSort
629 default-language: Haskell2010
630 main-is: MergeSort.hs
631 hs-source-dirs: examples
632 if flag(examples) || flag(examples-sdl)
633 buildable: True
634 build-Depends:
635 streamly
636 , base >= 4.8 && < 5
637 , random >= 1.0.0 && < 2
638 else
639 buildable: False
641executable AcidRain
642 default-language: Haskell2010
643 main-is: AcidRain.hs
644 hs-source-dirs: examples
645 if flag(examples) || flag(examples-sdl)
646 buildable: True
647 build-Depends:
648 streamly
649 , base >= 4.8 && < 5
650 , mtl >= 2.2 && < 3
651 if impl(ghc < 8.0)
652 build-depends:
653 semigroups >= 0.18 && < 0.19
654 , transformers >= 0.4 && < 0.6
655 else
656 buildable: False
658executable CirclingSquare
659 default-language: Haskell2010
660 main-is: CirclingSquare.hs
661 hs-source-dirs: examples
662 if flag(examples-sdl)
663 buildable: True
664 build-Depends:
665 streamly
666 , base >= 4.8 && < 5
667 , SDL >= 0.6.5 && < 0.7
668 else
669 buildable: False
671executable ControlFlow
672 default-language: Haskell2010
673 main-is: ControlFlow.hs
674 hs-source-dirs: examples
675 if flag(examples) || flag(examples-sdl)
676 buildable: True
677 build-Depends:
678 streamly
679 , base >= 4.8 && < 5
680 , exceptions >= 0.8 && < 0.11
681 , transformers >= 0.4 && < 0.6
682 , transformers-base >= 0.4 && < 0.5
683 if impl(ghc < 8.0)
684 build-depends:
685 semigroups >= 0.18 && < 0.19
686 else
687 buildable: False