forked from composewell/streamly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
streamly.cabal
1172 lines (1064 loc) · 36.6 KB
/
streamly.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
cabal-version: 2.2
name: streamly
version: 0.7.2
synopsis: Beautiful Streaming, Concurrent and Reactive Composition
description:
Streamly is a framework for writing programs in a high level, declarative
data flow programming paradigm. It provides a simple API, very close to
standard Haskell lists. A program is expressed as a composition of data
processing pipes, generally known as streams. Streams can be generated,
merged, chained, mapped, zipped, and consumed concurrently – enabling a high
level, declarative yet concurrent composition of programs. Programs can be
concurrent or non-concurrent without any significant change. Concurrency is
auto scaled based on consumption rate. Programmers do not have to be aware
of threads, locking or synchronization to write scalable concurrent programs.
Streamly provides C like performance, orders of magnitude better compared to
existing streaming libraries.
.
Streamly is designed to express the full spectrum of programs with highest
performance. Do not think that if you are writing a small and simple program
it may not be for you. It expresses a small "hello world" program with the
same efficiency, simplicity and elegance as a large scale concurrent
application. It unifies many different aspects of special purpose libraries
into a single yet simple framework.
.
Streamly covers the functionality provided by Haskell lists as well as the
functionality provided by streaming libraries like
<https://hackage.haskell.org/package/streaming streaming>,
<https://hackage.haskell.org/package/pipes pipes>, and
<https://hackage.haskell.org/package/conduit conduit> with a simpler API and
better performance. Streamly provides
advanced stream composition including various ways of appending, merging,
zipping, splitting, grouping, distributing, partitioning and unzipping of
streams with true streaming and with concurrency. Streamly subsumes the
functionality of list transformer libraries like @pipes@ or
<https://hackage.haskell.org/package/list-t list-t> and also the logic
programming library <https://hackage.haskell.org/package/logict logict>.
The grouping, splitting and windowing combinators in streamly can be compared
to the window operators in <https://flink.apache.org/ Apache Flink>.
However, compared to Flink streamly has a pure functional, succinct and
expressive API.
.
The concurrency capabilities of streamly are much more advanced and powerful
compared to the basic concurrency functionality provided by the
<https://hackage.haskell.org/package/async async> package. Streamly is a
first class reactive programming library. If you are familiar with
<http://reactivex.io/ Reactive Extensions> you will find that it is very
similar. For most RxJs combinators you can find or write corresponding ones
in streamly. Streamly can be used as an alternative to
<https://hackage.haskell.org/package/Yampa Yampa> or
<https://hackage.haskell.org/package/reflex reflex> as well.
.
Streamly focuses on practical engineering with high performance. From well
written streamly programs one can expect performance competitive to C. High
performance streaming eliminates the need for string and text libraries like
<https://hackage.haskell.org/package/bytestring bytestring>,
<https://hackage.haskell.org/package/text text> and their lazy and strict
flavors. The confusion and cognitive overhead arising from different
string types is eliminated. The two fundamental types in streamly are arrays
for storage and streams for processing. Strings and text are simply streams
or arrays of 'Char' as they should be. Arrays in streamly have performance
at par with the vector library.
.
Where to find more information:
.
* /Quick Overview/: <#readme README file> in the package
* /Building/: <src/docs/Build.md Build guide> for optimal performance
* /Detailed Tutorial/: "Streamly.Tutorial" module in the haddock documentation
* /Interoperation/: "Streamly.Tutorial" module for interop with other
streaming libraries
* /Reference Documentation/: Haddock documentation for the respective modules
* /Examples/: <src/examples examples directory> in the package
* /Guides/: <src/docs docs directory> in the package, for documentation on
advanced topics, limitations, semantics of the library or on specific use
cases.
* <https://github.com/composewell/streaming-benchmarks Streaming Benchmarks>
* <https://github.com/composewell/concurrency-benchmarks Concurrency Benchmarks>
.
homepage: https://github.com/composewell/streamly
bug-reports: https://github.com/composewell/streamly/issues
license: BSD-3-Clause
license-file: LICENSE
tested-with: GHC==7.10.3
, GHC==8.0.2
, GHC==8.4.4
, GHC==8.6.5
, GHC==8.8.1
author: Harendra Kumar
maintainer: streamly@composewell.com
copyright: 2017 Harendra Kumar
category: Control, Concurrency, Streaming, Reactivity
stability: Experimental
build-type: Configure
extra-source-files:
Changelog.md
credits/*.md
credits/base-4.12.0.0.txt
credits/bjoern-2008-2009.txt
credits/clock-0.7.2.txt
credits/foldl-1.4.5.txt
credits/pipes-concurrency-2.0.8.txt
credits/transient-0.5.5.txt
credits/vector-0.12.0.2.txt
credits/Yampa-0.10.6.2.txt
README.md
docs/streamly-vs-async.md
docs/streamly-vs-lists.md
docs/transformers.md
docs/Build.md
design/*.md
design/*.png
bench.sh
stack.yaml
src/Streamly/Internal/Data/Stream/Instances.hs
src/inline.hs
configure.ac
configure
src/Streamly/Internal/Data/Time/config.h.in
extra-tmp-files:
config.log
config.status
autom4te.cache
src/Streamly/Internal/Data/Time/config.h
source-repository head
type: git
location: https://github.com/composewell/streamly
flag fusion-plugin
description: Enable fusion plugin for better optimizations
manual: True
default: False
flag inspection
description: Enable inspection testing
manual: True
default: False
flag debug
description: Debug build with asserts enabled
manual: True
default: False
flag dev
description: Development build
manual: True
default: False
flag has-llvm
description: Use llvm backend for better performance
manual: True
default: False
flag no-charts
description: Disable chart generation
manual: True
default: False
flag no-fusion
description: Disable rewrite rules
manual: True
default: False
flag streamk
description: Use CPS style streams when possible
manual: True
default: False
flag examples
description: Build including examples
manual: True
default: False
flag examples-sdl
description: Build including SDL examples
manual: True
default: False
-------------------------------------------------------------------------------
-- Common stanzas
-------------------------------------------------------------------------------
common compile-options
default-language: Haskell2010
if flag(streamk)
cpp-options: -DUSE_STREAMK_ONLY
if flag(no-fusion)
cpp-options: -DDISABLE_FUSION
if flag(dev)
cpp-options: -DDEVBUILD
if flag(inspection)
cpp-options: -DINSPECTION
ghc-options: -Wall
if flag(has-llvm)
ghc-options: -fllvm
if flag(dev)
ghc-options: -Wmissed-specialisations
-Wall-missed-specialisations
if flag(dev) || flag(debug)
ghc-options: -fno-ignore-asserts
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wunrecognised-warning-flags
-Widentities
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wnoncanonical-monad-instances
common optimization-options
ghc-options: -O2
-fdicts-strict
-fspec-constr-recursive=16
-fmax-worker-args=16
common threading-options
ghc-options: -threaded
-with-rtsopts=-N
-- We need optimization options here to optimize internal (non-inlined)
-- versions of functions. Also, we have some benchmarking inspection tests
-- part of the library when built with --benchmarks flag. Thos tests fail
-- if we do not use optimization options here. It was observed that due to
-- -O2 here some concurrent/nested benchmarks improved and others regressed.
-- We can investigate a bit more here why the regression occurred.
common lib-options
import: compile-options, optimization-options
-- Compilation for coverage builds on CI machines takes too long without -O0
-- XXX we should use coverage flag for that, -O0 may take too long to run tests
-- in general.
common test-options
import: compile-options, threading-options
ghc-options: -O0
-fno-ignore-asserts
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
ghc-options: -fplugin Fusion.Plugin
build-depends:
fusion-plugin >= 0.1 && < 0.2
-- Used by maxrate test, benchmarks and executables
common exe-options
import: compile-options, optimization-options, threading-options
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
ghc-options: -fplugin Fusion.Plugin
build-depends:
fusion-plugin >= 0.1 && < 0.2
-- Some benchmarks are threaded some are not
-- XXX dependencies should be separated under bench-depends
common bench-options
import: compile-options, optimization-options
ghc-options: -with-rtsopts "-T -K32K -M16M"
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
ghc-options: -fplugin Fusion.Plugin
build-depends:
fusion-plugin >= 0.1 && < 0.2
build-depends: mtl >= 2.2 && < 3
common bench-options-threaded
import: compile-options, optimization-options
-- -threaded and -N2 is important because some GC and space leak issues
-- trigger only with these options.
ghc-options: -threaded -with-rtsopts "-T -N2 -K32K -M16M"
if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
ghc-options: -fplugin Fusion.Plugin
build-depends:
fusion-plugin >= 0.1 && < 0.2
build-depends: mtl >= 2.2 && < 3
-------------------------------------------------------------------------------
-- Library
-------------------------------------------------------------------------------
library
import: lib-options
js-sources: jsbits/clock.js
include-dirs: src/Streamly/Internal/Data/Time
, src
if os(windows)
c-sources: src/Streamly/Internal/Data/Time/Windows.c
if os(darwin)
c-sources: src/Streamly/Internal/Data/Time/Darwin.c
hs-source-dirs: src
other-modules:
Streamly.Data.Array
, Streamly.Data.SmallArray
, Streamly.Data.Prim.Array
-- Memory storage
Streamly.Memory.Malloc
, Streamly.Memory.Ring
, Streamly.FileSystem.IOVec
, Streamly.FileSystem.FDIO
, Streamly.FileSystem.FD
exposed-modules:
Streamly.Prelude
, Streamly
, Streamly.Data.Fold
, Streamly.Data.Unfold
, Streamly.Data.Unicode.Stream
-- IO devices
, Streamly.Memory.Array
, Streamly.FileSystem.Handle
, Streamly.Tutorial
-- Internal modules
, Streamly.Internal.Control.Monad
, Streamly.Internal.Data.Strict
, Streamly.Internal.Data.Atomics
, Streamly.Internal.Data.Time
, Streamly.Internal.Data.Time.Units
, Streamly.Internal.Data.Time.Clock
, Streamly.Internal.Data.SVar
, Streamly.Internal.Data.Array
, Streamly.Internal.Data.Prim.Array.Types
, Streamly.Internal.Data.Prim.Array
, Streamly.Internal.Data.SmallArray.Types
, Streamly.Internal.Data.SmallArray
, Streamly.Internal.Memory.Array.Types
, Streamly.Internal.Memory.Array
, Streamly.Internal.Memory.ArrayStream
, Streamly.Internal.Data.Fold.Types
, Streamly.Internal.Data.Fold
, Streamly.Internal.Data.Sink.Types
, Streamly.Internal.Data.Sink
-- Base streams
, Streamly.Internal.Data.Stream.StreamK.Type
, Streamly.Internal.Data.Stream.StreamK
, Streamly.Internal.Data.Stream.StreamD.Type
, Streamly.Internal.Data.Stream.StreamD
, Streamly.Internal.Data.Stream.StreamDK.Type
, Streamly.Internal.Data.Stream.StreamDK
, Streamly.Internal.Data.Stream.Enumeration
, Streamly.Internal.Data.Stream.Prelude
-- Higher level streams
, Streamly.Internal.Data.Stream.SVar
, Streamly.Internal.Data.Stream.Serial
, Streamly.Internal.Data.Stream.Async
, Streamly.Internal.Data.Stream.Parallel
, Streamly.Internal.Data.Stream.Ahead
, Streamly.Internal.Data.Stream.Zip
, Streamly.Internal.Data.Stream.Combinators
, Streamly.Internal.Data.Unfold.Types
, Streamly.Internal.Data.Unfold
, Streamly.Internal.Data.Pipe.Types
, Streamly.Internal.Data.Pipe
, Streamly.Internal.Data.List
, Streamly.Internal.FileSystem.Handle
, Streamly.Internal.FileSystem.Dir
, Streamly.Internal.FileSystem.File
, Streamly.Internal.Data.Unicode.Stream
, Streamly.Internal.Data.Unicode.Char
, Streamly.Internal.Memory.Unicode.Array
, Streamly.Internal.Prelude
, Streamly.Internal.Fusion
-- Mutable data
, Streamly.Internal.Mutable.Prim.Var
if !impl(ghcjs)
exposed-modules:
Streamly.Network.Socket
, Streamly.Network.Inet.TCP
, Streamly.Internal.Network.Socket
, Streamly.Internal.Network.Inet.TCP
build-depends:
-- Core libraries shipped with ghc, the min and max
-- constraints of these libraries should match with
-- the GHC versions we support
base >= 4.8 && < 5
, containers >= 0.5 && < 0.7
, deepseq >= 1.4.1 && < 1.5
, directory >= 1.2.2 && < 1.4
, exceptions >= 0.8 && < 0.11
, ghc-prim >= 0.2 && < 0.6
, mtl >= 2.2 && < 3
, primitive >= 0.5.4 && < 0.8
, transformers >= 0.4 && < 0.6
, heaps >= 0.3 && < 0.4
-- concurrency
, atomic-primops >= 0.8 && < 0.9
, lockfree-queue >= 0.2.3 && < 0.3
-- transfomers
, monad-control >= 1.0 && < 2
, transformers-base >= 0.4 && < 0.5
if !impl(ghcjs) && !impl(ghc < 8.6)
build-depends:
fusion-plugin >= 0.1 && < 0.2
if !impl(ghcjs)
build-depends:
network >= 2.6 && < 4
if impl(ghc < 8.0)
build-depends:
semigroups >= 0.18 && < 0.19
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.16
, inspection-testing >= 0.4 && < 0.5
-- Array uses a Storable constraint in dev build making several inspection
-- tests fail
if flag(dev) && flag(inspection)
build-depends: inspection-and-dev-flags-cannot-be-used-together
-------------------------------------------------------------------------------
-- Test suites
-------------------------------------------------------------------------------
test-suite test
import: test-options
type: exitcode-stdio-1.0
main-is: Main.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, hspec >= 2.0 && < 3
, containers >= 0.5 && < 0.7
, transformers >= 0.4 && < 0.6
, mtl >= 2.2 && < 3
, exceptions >= 0.8 && < 0.11
default-language: Haskell2010
test-suite internal-prelude-test
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Internal/Prelude.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
default-language: Haskell2010
test-suite pure-streams-base
import: test-options
type: exitcode-stdio-1.0
main-is: PureStreams.hs
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, hspec >= 2.0 && < 3
default-language: Haskell2010
test-suite pure-streams-streamly
import: test-options
type: exitcode-stdio-1.0
main-is: PureStreams.hs
hs-source-dirs: test
cpp-options: -DUSE_STREAMLY_LIST
build-depends:
streamly
, base >= 4.8 && < 5
, hspec >= 2.0 && < 3
default-language: Haskell2010
test-suite properties
import: test-options
type: exitcode-stdio-1.0
main-is: Prop.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
test-suite array-test
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Array.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
cpp-options: -DTEST_ARRAY
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
test-suite internal-data-fold-test
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Internal/Data/Fold.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, hspec >= 2.0 && < 3
, QuickCheck >= 2.10 && < 2.14
default-language: Haskell2010
test-suite data-array-test
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Array.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
test-suite smallarray-test
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Array.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
cpp-options: -DTEST_SMALL_ARRAY
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
test-suite primarray-test
import: test-options
type: exitcode-stdio-1.0
main-is: Streamly/Test/Array.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
cpp-options: -DTEST_PRIM_ARRAY
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
test-suite string-test
import: test-options
type: exitcode-stdio-1.0
main-is: String.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
build-depends:
streamly
, base >= 4.8 && < 5
, QuickCheck >= 2.10 && < 2.14
, hspec >= 2.0 && < 3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
default-language: Haskell2010
test-suite maxrate
import: exe-options
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: MaxRate.hs
js-sources: jsbits/clock.js
hs-source-dirs: test
if flag(dev)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
, clock >= 0.7.1 && < 0.9
, hspec >= 2.0 && < 3
, random >= 1.0.0 && < 2
else
buildable: False
test-suite loops
import: test-options
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: loops.hs
hs-source-dirs: test
build-Depends:
streamly
, base >= 4.8 && < 5
test-suite nested-loops
import: test-options
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: nested-loops.hs
hs-source-dirs: test
build-Depends:
streamly
, base >= 4.8 && < 5
, random >= 1.0.0 && < 2
test-suite parallel-loops
import: test-options
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: parallel-loops.hs
hs-source-dirs: test
build-Depends:
streamly
, base >= 4.8 && < 5
, random >= 1.0.0 && < 2
test-suite version-bounds
import: test-options
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: version-bounds.hs
hs-source-dirs: test
build-Depends:
streamly
, ghc
, base >= 4.8 && < 5
-------------------------------------------------------------------------------
-- Benchmarks
-------------------------------------------------------------------------------
-- For linear, linear-async, linear-rate, nested and nested-concurrent
-- you can pass the number of elements in the stream using the
-- --stream-size option:
-- $ cabal run linear -- --stream-size 1000000
benchmark linear
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
-- XXX heap/stack limits can be reduced once we split out the buffered
-- benchmarks into a separate suite
ghc-options: -with-rtsopts "-T -K4M -M128M"
main-is: Linear.hs
other-modules: Streamly.Benchmark.Prelude, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.16
, inspection-testing >= 0.4 && < 0.5
benchmark nested
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -K256K -M16M"
main-is: Nested.hs
other-modules: NestedOps, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark nested-unfold
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -K64K -M16M"
main-is: NestedUnfold.hs
other-modules: NestedUnfoldOps, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark unpinned-array
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -K1K -M128M"
main-is: Streamly/Benchmark/Data/Array.hs
other-modules: Streamly.Benchmark.Data.ArrayOps
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark prim-array
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -K64K -M32M"
main-is: Streamly/Benchmark/Data/Prim/Array.hs
other-modules: Streamly.Benchmark.Data.Prim.ArrayOps
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark small-array
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -K128K -M16M"
main-is: Streamly/Benchmark/Data/SmallArray.hs
other-modules: Streamly.Benchmark.Data.SmallArrayOps
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark array
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -K64K -M128M"
main-is: Array.hs
other-modules: ArrayOps
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark fileio
import: bench-options
type: exitcode-stdio-1.0
-- A value of 400 works better for some benchmarks, however, it takes
-- extraordinary amount of time to compile with that.
-- ghc-options: -funfolding-use-threshold=150
hs-source-dirs: benchmark
main-is: FileIO.hs
other-modules: Streamly.Benchmark.FileIO.Array
, Streamly.Benchmark.FileIO.Stream
build-depends:
streamly
, base >= 4.8 && < 5
, gauge >= 0.2.4 && < 0.3
, typed-process >= 0.2.3 && < 0.3
, deepseq >= 1.4.1 && < 1.5
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.16
, inspection-testing >= 0.4 && < 0.5
-------------------------------------------------------------------------------
-- Threaded Benchmarks
-------------------------------------------------------------------------------
benchmark linear-async
import: bench-options-threaded
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -N2 -K64K -M16M"
main-is: LinearAsync.hs
other-modules: Streamly.Benchmark.Prelude, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.16
, inspection-testing >= 0.4 && < 0.5
benchmark nested-concurrent
import: bench-options-threaded
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
-- XXX this can be lowered once we split out the finite benchmarks
ghc-options: -with-rtsopts "-T -N2 -K256K -M128M"
main-is: NestedConcurrent.hs
other-modules: NestedOps, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
benchmark parallel
import: bench-options-threaded
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
ghc-options: -with-rtsopts "-T -N2 -K128K -M256M"
main-is: Parallel.hs
other-modules: Streamly.Benchmark.Prelude, NestedOps, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.16
, inspection-testing >= 0.4 && < 0.5
benchmark linear-rate
import: bench-options-threaded
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
main-is: LinearRate.hs
other-modules: Streamly.Benchmark.Prelude, Common
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.16
, inspection-testing >= 0.4 && < 0.5
benchmark concurrent
import: bench-options-threaded
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
main-is: Concurrent.hs
ghc-options: -with-rtsopts "-T -N2 -K256K -M384M"
build-depends:
streamly
, base >= 4.8 && < 5
, gauge >= 0.2.4 && < 0.3
-------------------------------------------------------------------------------
-- Internal benchmarks
-------------------------------------------------------------------------------
benchmark base
import: bench-options
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
if flag(dev)
cpp-options: -DDEVBUILD
ghc-options: -with-rtsopts "-T -K2M -M16M"
else
ghc-options: -with-rtsopts "-T -K128K -M16M"
main-is: BaseStreams.hs
other-modules: StreamDOps
, StreamKOps
, StreamDKOps
build-depends:
streamly
, base >= 4.8 && < 5
, deepseq >= 1.4.1 && < 1.5
, random >= 1.0 && < 2.0
, gauge >= 0.2.4 && < 0.3
executable nano-bench
import: bench-options
hs-source-dirs: benchmark
main-is: NanoBenchmarks.hs
if flag(dev)
buildable: True
build-depends:
streamly
, base >= 4.8 && < 5
, gauge >= 0.2.4 && < 0.3
, random >= 1.0 && < 2.0
else
buildable: False
benchmark adaptive
import: bench-options-threaded
type: exitcode-stdio-1.0
hs-source-dirs: benchmark
main-is: Adaptive.hs
default-language: Haskell2010
build-depends:
streamly
, base >= 4.8 && < 5
, gauge >= 0.2.4 && < 0.3
, random >= 1.0 && < 2.0
if impl(ghc < 8.0)
build-depends:
transformers >= 0.4 && < 0.6
executable chart
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: benchmark
main-is: Chart.hs
if flag(dev) && !flag(no-charts) && !impl(ghcjs)
buildable: True
build-Depends:
base >= 4.8 && < 5
, bench-show >= 0.3 && < 0.4
, split
, transformers >= 0.4 && < 0.6
else
buildable: False
-------------------------------------------------------------------------------
-- Examples
-------------------------------------------------------------------------------
executable SearchQuery
import: exe-options
main-is: SearchQuery.hs
hs-source-dirs: examples
if (flag(examples) || flag(examples-sdl)) && !impl(ghcjs)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
, http-conduit >= 2.2.2 && < 2.4
else
buildable: False
executable ListDir
import: exe-options
main-is: ListDir.hs
hs-source-dirs: examples
if flag(examples) || flag(examples-sdl)
buildable: True
build-Depends:
streamly
, base >= 4.8 && < 5
if impl(ghc < 8.0)