Note that the drop in "mapM" performance in concurrent benchmarks is due to a
benchmark change. We now use the parallel verison of unfoldrM instead of serial
version to generate the stream.
rename:
unStream to foldStream
unStreamShared to foldStreamShared
unStreamSVar to foldStreamSVar
Change the order of arguments to match the standard fold convention.
Make them polymorphic so as to make them more convenient to use without having
to always use fromStream/toStream.
TBD: check performance impact
1. removed redundant rstState from mergeAsyncBy and mergeByS
2. renamed rstState to adaptState, as it is now used only coerce one state type to
another.
3. renamed isolateStream to unShare
4. made StreamD as well safer by clearing the SVar sharing during pattern match
1) Hide the `Stream` constructor, use `mkStream` instead.
2) Change `unStream` to use `rstState`.
3) Use `unStreamShared` to share the `SVar`.
4) Remove `unStreamIsolated`, use `unStream` instead.
5) Change all `unStream m (rstState st)` to `unStream m st`
6) Change all `unStream m st` to `unStreamShared m st`
APIs
----
Removed:
merge
lazy left scans: scanl, scanlM, scanl1, scanl1M
Renamed:
generate and generateM renamed to fromIndices and fromIndicesM
Added:
replicate
mergeByM, mergeAsyncBy, mergeAsyncByM
`intFrom`, `intFromTo`, `intFromThen`, `intFromThenTo`,
`intFromStep`, `fracFrom`, `fracFromThen`, `fracFromThenTo`,
`numFromStep`
Added StreamD version of replicateM and a rewrite rule for replicateMSerial.
Added but not exposed:
postscanl and prescanl ops
Rewrote mergeByS in StreamK, simplified quite a bit and got some perf
improvement too.
Added @since notations to new APIs.
Fixed lines exceeding 80 columns.
Tests
-----
Added tests for the new enumeration APIs.
Improved some tests by generating values randomly using quickcheck forAll. We
can improve more tests similarly.
Removed some redundant transformOps tests.
reorganized test code in groups so as to keep similar functionality together
and added header lines so that we can find relevant code easily.
Benchmarks
----------
Added benchmarks for enumeration primitives added above. Added benchmarks for
scan and fold mixed ops. Added benchmark for concatMap. Fixed foldr and foldrM
benchmarks to use a (+) operation instead of a list operation for fair
comparision with other folds.
Kept only one benchmark each for deleteBy, insertBy, isPrefixOf and
isSubsequenceOf.
Documentation
-------------
Updated documentation, added examples for the new primitives as well as many
old ones. Especially the documentation of folds and scans was rewritten.
Reordered and re-organized the groups of APIs in the doc.
Refactoring
-----------
Some related and urelated refactoring.
Hlint
-----
Fixed some hlint hints introduced recently.
TBD
---
Some APIs need concurrent versions. I have added "XXX" notes for those.
Some more tests have to be added.
Some more benchmarks have to be added.
1) Add foldr1, findIndices, lookup, find, sequence functions
in StreamD, earlier they were present only in StreamK.
2) Change the above functions to use S. in Prelude instead
of K. .
3) Add tests for (!!), insertBy, splitAt, the.
1) Define the instances manually instead of deriving. Deriving picks up
incorrect implementations of methods that have been redefined in the newtypes.
2) Fix the Traversable instance.
3) Define the instances only for Serial stream types. Other streams cannot be
instantiated for Foldable monads.
4) Add test cases
5) add benchmarks