Commit Graph

160 Commits

Author SHA1 Message Date
Harendra Kumar
6ae6879887 rename maxRate to yieldRate, update doc 2018-08-18 01:51:52 +05:30
Harendra Kumar
c9aecb3486 Fix some issues in yield limit handling for aheadly 2018-08-16 04:40:49 +05:30
Harendra Kumar
05ca066661 Add GC based cleanup of SVars 2018-08-15 05:56:35 +05:30
Harendra Kumar
2c0a6fbd31 cancel parallel tasks when take completes 2018-08-14 23:19:29 +05:30
Harendra Kumar
e1b6740a7c reduce ci tests 2018-08-12 18:20:03 +05:30
Harendra Kumar
7f05a78f1b use stack builds, make coverage build faster 2018-08-12 18:20:03 +05:30
Harendra Kumar
c602d84990 Fix "not sufficient concurrency" in ahead streams 2018-08-12 18:20:03 +05:30
Harendra Kumar
b33e9c274b performance improvements after maxrate changes 2018-08-12 18:20:03 +05:30
Harendra Kumar
610c33a504 Add concurrency rate control using maxRate 2018-08-12 18:20:03 +05:30
Harendra Kumar
c39a442ddf Add benchmarks and tests for new operations
Also fix the signature of foldl1'
Add notes about state passing
2018-08-09 00:43:48 +05:30
Harendra Kumar
cd50805c92 Do not share concurrency state in concurrent function application 2018-08-08 17:17:56 +05:30
Veladus
8fec7c27ae Generalized eliminateOp and transform; add test for Prelude#lookup 2018-07-24 18:45:52 +02:00
Veladus
a9aa3aeef8 Add Prelude#foldl1', Prelude#foldr1 2018-07-24 18:45:52 +02:00
Veladus
9706067159 Add Prelude#intersperseM 2018-07-24 18:45:35 +02:00
Veladus
74ce247d71 Add Prelude#find, Prelude#lookup 2018-07-24 18:28:30 +02:00
Veladus
52eccb97e7 Add Prelude#findIndices, Prelude#findIndex, Prelude#elemIndices, Prelude#elemIndex 2018-07-24 18:27:11 +02:00
Veladus
e6c75f6aa9 Add Prelude#init 2018-07-24 18:23:56 +02:00
Harendra Kumar
55f9cfa371 fix foldxM strictness
The main change is a single line change in StreamK.hs in foldxM routine.

Major changes in this commit are due to:
1) Added strictness tests for all foldl and scanl rotuines
2) refactoring to enable independent benchmarking for StreamK, to measure the
  impact of the change.
2018-07-13 19:00:38 +05:30
Harendra Kumar
cf87d1132e implement maxYields to put a limit on total yields of a stream
maxYields is used to limit the concurrent executions of a stream when
it it is immediately followed by a "take" limiting the size of the stream.

Also fix the maxBuffer implementation of aheadly.
2018-07-02 08:46:57 +05:30
Harendra Kumar
a362b53762 reduce the number of prop tests to enable coverage
coverage builds take too long with default number of property tests
2018-07-02 00:49:28 +05:30
Harendra Kumar
72766cb82b rename threads to maxThreads and buffer to maxBuffer 2018-07-01 23:53:10 +05:30
Harendra Kumar
211df792a4 Add concurrency control using "threads" and "buffer"
Also exposed the "filterM" API.

Some benchmarks are affected with this. The most affected benchmarks are:

StreamK ops:
before:
serially/generation/foldMapWith          mean 1.940 ms
serially/generation/foldMapWithM         mean 3.891 ms

After:
serially/generation/foldMapWith          mean 2.874 ms
serially/generation/foldMapWithM         mean 5.003 ms

StreamD ops:
zip/zipM are affected
2018-07-01 02:43:48 +05:30
Harendra Kumar
9fe6dc1726 use direct style zipWith and zipWithM 2018-06-27 09:10:39 +05:30
Harendra Kumar
2b1093a8dc use workaround for stack/ghc-8.2.2 crash 2018-06-25 06:58:47 +05:30
Harendra Kumar
0b6d7a22d7 increase the delay in concurrent ordering tests 2018-06-23 17:31:58 +05:30
Harendra Kumar
b856396e14 rename some qualified imports 2018-06-23 07:41:21 +05:30
Harendra Kumar
9c85811905 rename "once" to "yieldM"
and some other related refactoring changes.
2018-06-23 06:50:59 +05:30
Harendra Kumar
09fcf275d7 remove incorrect test for WAsync
Add a test for Parallel
2018-06-22 04:00:28 +05:30
Harendra Kumar
b9d8f28edd Fix memory barriers and worker dispatches 2018-06-14 17:02:28 +05:30
Harendra Kumar
c28f3f1c47 Fix a concurrency bug in filtering ops
The bug causes the ops take, takeWhile, drop, dropWhile, filter and reverse to
behave incorrectly due to illegal sharing of SVar across ops.
2018-06-05 19:27:39 +05:30
Harendra Kumar
4c00da9ab4
Merge pull request #76 from subbyte/master
mapMaybe and mapMaybeM Implemented
2018-05-30 05:24:58 +05:30
Xiaokui Shu
e46d341819 add mapMaybe and mapMaybeM 2018-05-29 13:12:27 -04:00
Harendra Kumar
c77d3fbd62 More consistent naming of operators 2018-05-28 13:24:42 +05:30
Harendra Kumar
e60357957c Add concurrent function application operators 2018-05-26 17:02:36 +05:30
Harendra Kumar
dfecce27eb Fix build for ghc-7.10 and 8.0 2018-05-24 17:35:18 +05:30
Harendra Kumar
9cb2ac0bb7 Add concurrent generation and transformation capabilities
- monadic stream generation functions are now concurrent
- monadic stream transformation (mapM, sequence) functions are now concurrent
- fixed a race which caused blockedindefinitely on MVar in rare cases
2018-05-24 16:48:48 +05:30
Harendra Kumar
9da3fccd20 Add concurrent lookahead stream type "Ahead" 2018-05-17 11:22:29 +05:30
Harendra Kumar
9c9b27949c Fix missing nomenclature changes 2018-05-13 11:05:33 +05:30
Harendra Kumar
b03a7b60f9 Fix nomenclature in tests 2018-05-13 10:42:03 +05:30
Harendra Kumar
ce79079002 Add a thread limit for async ahead types
currently hardcoded to 1500 threads
2018-05-11 01:49:26 +05:30
Harendra Kumar
091f4b69fe Add the strictly parallel stream type ParallelT 2018-05-08 07:49:43 +05:30
Harendra Kumar
74dd5a01b6 rename streams with a consistent and intuitive scheme
The trigger for this change is that parallel stream is not really parallel it is
a concurrent lookahead like just in a different traversal style. So we make
parallel and coparallel as parAhead and coparAhead instead and later introduce
a new style for parallel which would be strictly parallel with one thread for
each stream started right away rather than speculatively.
2018-05-07 19:17:02 +05:30
Harendra Kumar
b214a85407 remove redundant re-exports 2018-05-04 02:04:15 +05:30
Harendra Kumar
c5f97f0e3b Move examples from Streamly module to examples dir 2018-05-04 01:28:02 +05:30
Harendra Kumar
f3dbbde613 move example files 2018-05-04 01:28:02 +05:30
Harendra Kumar
a526207acd rename the default stream type to StreamT
This was earlier changed from StreamT to SerialT. However we have made this the
default type now and it makes more sense to call it StreamT now. A bigger
motivation for the change is that StreamT immediately conveys that it is a
stream which is helpful and intuitive for new learners. Also we have a plan to
have a specialized type called "Stream a = StreamT IO a", so the name StreamT
is in line with that common default type "Stream a". Calling that type as
"Serial a" does not sound as intuitive as calling it "Stream a".
2018-04-25 11:31:12 +05:30
Harendra Kumar
0810ad78e6 remove the numeric instances 2018-04-22 23:23:23 +05:30
Harendra Kumar
e411ab6abd Remove MonadError instance temporarily
It is not working correctly for parallel compositions.
2018-04-22 22:57:31 +05:30
Harendra Kumar
30a6e32fee Fix Monoid and other instances
Monoid instances should not be derived from underlying type where we want them
to be type specific. Added tests to make sure they are correct.

Other typeclass instances that are dependent on type specific behavior should
also be independently defined rather than derived.

Removed Alternative instances as they are not correct yet.

Removed redundancy by using CPP macros to define instances of different types.
2018-04-22 15:59:09 +05:30
Harendra Kumar
071a90a00c rename some zip operations and MonadAsync type 2018-04-18 20:14:29 +05:30