Commit Graph

1180 Commits

Author SHA1 Message Date
Harendra Kumar
e511962625 Fix conversion of MicroSecond64 and MilliSecond64 2020-05-28 10:07:41 +05:30
Harendra Kumar
7013f3a5e4 Fix delayPost, add more interspersing combinators
delayPost was actually behaving like delayPre, fixed it.
Added: trace_, intersperseM_, interspersePrefix_, delayPre
2020-05-27 19:26:26 +05:30
Harendra Kumar
7f9d4a4210 Add some time related combinators
add: times, relTimes, timestamped
unimplemented skeletons: durations, ticks, timeout

Changes to the original currentTime combinator: remove delay from the first
event, cap the granularity to 1 ms to guarantee reasonable cpu usage.
2020-05-27 12:21:54 +05:30
Pranay Sashank
9e6d245a3e Remove extraneous file Streamly.Examples 2020-05-18 10:48:45 +05:30
Ahmed Zaheer Dadarkar
64e8b3801a updated definition of parseK to use throwM instead of error 2020-05-16 14:30:56 +05:30
Harendra Kumar
df553b1d5b fix hlint warnings
and remove fixed files from .hlint.ignore
2020-05-15 10:18:59 +05:30
Sanchayan Maity
c9eff7e271 Cleanup hlint warnings
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-05-15 10:11:06 +05:30
Harendra Kumar
e84612f179 Add connect and connectFrom 2020-05-12 05:55:15 +05:30
Harendra Kumar
96aa91d2a4 Close the socket on exception
in "accept" and "connections"
otherwise it will be closed only on garbage collection.
2020-05-12 05:55:15 +05:30
Harendra Kumar
d0b558e521 close socket on exception (in connect) 2020-05-12 05:55:15 +05:30
Harendra Kumar
40d1e6423d Fix a bug in YieldB case 2020-05-11 21:25:24 +05:30
Harendra Kumar
2c9feb48ef Add YieldB (yield and backtrack) constructor
This fixes an issue in many/some/manyTill combinators.
2020-05-11 21:25:24 +05:30
Harendra Kumar
633c55eb31 rename splitParse/parseMany, concatParse/parseIterate 2020-05-11 21:18:09 +05:30
Harendra Kumar
1889b4eef6 update fold documentation 2020-05-11 21:17:32 +05:30
Harendra Kumar
684d2786eb Add concatParse to chain parsers on a stream
Add mconcatTo, update fold docs
Add fold docs/snippets using Monoids.
Add benchmark for sum using foldMap
Add concatParse benchmark
Add splitParseTill, update docs
2020-05-11 20:54:22 +05:30
Shruti_Umat
0911988b4e explain mapM, sequence functions 2020-05-04 12:06:31 +05:30
Shruti_Umat
3957ceed99 fix output explanation of wAsyncly
typo fix in StreamD coding style
2020-05-04 12:06:31 +05:30
Harendra Kumar
7af52d33b7 remove duplicate code 2020-04-24 04:29:12 +05:30
Harendra Kumar
9d4e6a2036 Fix exception handling
Check for ParseError exception instead of SomeException
Fix some comments.
2020-04-24 04:15:27 +05:30
Harendra Kumar
899cab5cd4 Make License Identifier SPDX compliant 2020-04-24 03:57:46 +05:30
Harendra Kumar
d7866f732d INLINE some/many implement *>/<*
Benchmarks that improved:

ParserK(cpuTime)
Benchmark                   default(0)(μs) default(1) - default(0)(%)
--------------------------- -------------- --------------------------
o-n-heap/parserK/sequenceA_       11183.17                     -32.75
o-n-heap/parserK/manyAlt          41514.00                     -40.82
o-n-heap/parserK/someAlt          68026.25                     -61.77
2020-04-24 02:59:40 +05:30
Harendra Kumar
dde9041833 Use parserK by default and rewrite to ParserD 2020-04-24 00:30:01 +05:30
Harendra Kumar
a03e2872a6 rename Parser module to ParserD
The top level module "Parser" will be using both ParserK and ParserD.
2020-04-24 00:30:01 +05:30
Harendra Kumar
12fef4390f Add a CPS style parser implementation
CPS performs much better for parsing operations like "sequence" and
"choice" on large containers. Given that applicative "sequence" does
not scale, I guess the Monad instance as well won't scale for direct
implementation.
2020-04-24 00:30:01 +05:30
Pranay Sashank
828a564781 Add GHC 8.10.1 build to CI.
- Disable inspection testing for `fromStreamVar`.
- Fix overlapping pattern matches warning in test/Main.hs.
2020-04-22 14:32:30 +05:30
Harendra Kumar
f51bbb25bd Rename some parsers and add some TBD and comments 2020-04-16 23:11:49 +05:30
Harendra Kumar
e6d4570ccd Add isAsciiAlpha 2020-04-16 23:11:36 +05:30
Harendra Kumar
007343a84e Add eqBy to match a sequence 2020-04-16 23:11:29 +05:30
Harendra Kumar
c8bbb0a1c8 Add lookAhead 2020-04-16 23:11:22 +05:30
Harendra Kumar
3622e37b4e Add takeWhile1 2020-04-16 23:11:14 +05:30
Harendra Kumar
5e8f2c7a13 Add documentation on Fold/Parser design 2020-04-16 22:24:26 +05:30
Harendra Kumar
88e55f7051 Add Monad and MonadPlus instances 2020-04-16 21:15:02 +05:30
Harendra Kumar
efebe0f11f Add FUSE annotations to "tee" state constructors 2020-04-14 23:34:08 +05:30
Harendra Kumar
202c33d6e8 Add Alternative instance, combinators and parsers
parsers: peek, satisfy, eof, yield, yieldM, die, dieM
combinators: shortest, longest, alt, many, some, manyTill
2020-04-14 23:34:08 +05:30
Harendra Kumar
63c646ac79 Use warning suppression only for GHC >= 8.0 2020-04-14 22:51:53 +05:30
Harendra Kumar
8921064283 Add teeWith - distribute input to 2 parsers
This is perhaps not an ideal implementation but something to play with.
2020-04-14 22:51:53 +05:30
Harendra Kumar
f6327e5b31 Use exceptions instead of Either return in extract
Also instead of returning wrapped state in "Stop" return type, return
the final extracted value.

  a) This makes a lot of code simpler because extract and error handling
     is not required at Stop.

  b) Not returning internal state indicates that the parse has ended and
     state is not supposed to be used from this point onwards.

  c) It may add a little complexity in the parser code as the parser has to
     extract the value from state at Stop.

  d) However, extract is still needed. But it is only needed if the fold
     remains partial when the stream stops. In such case we may have to
     use exception handling to detect error, and to distinguish the parse
     errors from any other types of errors. But since this is not common
     case it does not come in the fast path.

Note that we could remove extract altogether but that means we will have to
store the intermediate fold values in the driver loop which impacts
performance.
2020-04-14 22:51:53 +05:30
Pranay Sashank
b43812937e Fix -Wunused-record-wildcards warnings. 2020-04-12 11:19:23 +05:30
adithyaov
42e2dc28ec Remove unessary code from Prim.Type 2020-04-12 09:40:38 +05:30
adithyaov
2f5874dde6 Fix build for primitive-0.6.3.0. Solves #466. 2020-04-12 09:40:38 +05:30
Harendra Kumar
ab541b4888 specialize the "Skip 0" case in "parse" 2020-04-09 04:19:00 +05:30
Harendra Kumar
f1eb9a18c2 rename parseChunks to splitParse 2020-04-09 04:19:00 +05:30
Harendra Kumar
341a42a11d Implement parser applicative using splitWith operation
The applicative op is now available as a named function "splitWith".
2020-04-09 04:19:00 +05:30
Harendra Kumar
57261e0f6c Add fromFold to upgrade folds to parsers 2020-04-09 04:19:00 +05:30
Harendra Kumar
b9c461f7b9 rename some parsers, add some parsers
rename endOn etc to sepBy etc.
add sepByMax
add unimplemented skeletons for wordBy, groupBy
2020-04-09 04:19:00 +05:30
Harendra Kumar
31e269a848 Factor out "pure" as "wrap"
It can be reused in other applicative instances as well.
2020-04-09 04:19:00 +05:30
Harendra Kumar
e6eb517fe1 Add Fuse annotation on concat 2020-04-09 04:19:00 +05:30
Harendra Kumar
94459757dd Fix dates/typo/Functor instance 2020-04-09 04:06:57 +05:30
Harendra Kumar
c3a7e602c2 Fix takeAtLeast implementation
Use "Yield" instead of "Skip" after "n" elements. This also shows that "Yield"
and "Skip" are more intuitive for writing parsers.
2020-04-09 04:06:57 +05:30
Harendra Kumar
136bf79bab Rename Parse type and Step constructors
Parse => Parser
Keep => Yield
Back => Skip
2020-04-09 04:06:57 +05:30
Harendra Kumar
cc8cd01bfe Simplify the Parse type
* Return the unused count in Halt instead of in extract.
* Use "Back 0" instead of "Hold"

Performance seems equivalent with these changes.
2020-04-09 04:06:57 +05:30
Harendra Kumar
ba08f9fecc Add Fuse annotation to parser constructors 2020-04-09 04:06:57 +05:30
Harendra Kumar
2723c15d36 Implement stream parsing
This is the initial version of stream parsing. It implements a "Parse"
type, some parsers based on that type, applicative composition, operations to
run parsers (parse) and to run parsers over chunks of a stream (parseChunks).

Parsers are just an extension of Folds in Streamly.Data.Fold. Parsers just add
backtracking and failure capabilities to folds.

Operations like splitOn to split a stream on a predicate can now be expressed
using a parser applied repeatedly on a stream. For example, line splitting can
be done using parsers. Parsers are as fast as fastest custom code for
line splitting.
2020-04-09 04:06:57 +05:30
pranaysashank
97523d9300 Use Hlint's <$> suggestion judiciously 2020-04-03 16:15:57 +05:30
Sanchayan Maity
3ea1cb285a Streamly: Internal: Memory: Cleanup hlint warnings
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-04-02 10:44:34 +05:30
Sanchayan Maity
4635e20567 Streamly: Internal: FileSystem: Cleanup hlint warnings
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-04-02 10:44:34 +05:30
adithyaov
619b57444d Remove improper instances from Fold as discussed in #449
https://github.com/composewell/streamly/pull/449#discussion_r396201192
2020-03-24 15:40:01 +05:30
Julian Ospald
42fe1a1932 Fix build on i386_HOST_ARCH
Fixes #452
2020-03-22 23:44:32 +05:30
Shlok Datye
c5d087130e Added comments. 2020-03-21 16:39:09 +05:30
Shlok Datye
8f4f9ed287 Mask async exceptions in the "bracketIO" functions.
Without this change, there are points (between "bef" and registration of "aft") at which async exceptions can cause resource leaks.
2020-03-21 16:39:09 +05:30
adithyaov
62bb140bd1 Update streamly version to 0.7.1 in configure.ac and run autoreconf 2020-03-06 11:32:53 +05:30
adithyaov
11708d3569 Fix build for Windows systems when _Win32 is defined 2020-03-06 11:32:53 +05:30
adithyaov
a95e1444ba Check for Windows APIs before POSIX in Clock.hsc 2020-03-06 11:32:53 +05:30
Harendra Kumar
3eaf609867 improve doc for splitInnerBy 2020-03-05 01:27:43 +05:30
Harendra Kumar
27c2dd9ec1 Move fold compositions from Prelude to Data.Fold 2020-03-05 01:27:43 +05:30
Harendra Kumar
eb71508749 improve Network.Socket doc and example 2020-03-05 01:22:31 +05:30
Harendra Kumar
e754561195 Add strip/drop prefix/infix/suffix APIs/signatures
Some of these are implemented suboptimally and some are yet to be implemented.
2020-02-28 02:49:01 +05:30
Harendra Kumar
8f0ceb1783 Add mconcat 2020-02-28 02:47:22 +05:30
Harendra Kumar
c05fe6039c Add "concat" 2020-02-28 02:47:22 +05:30
Harendra Kumar
fe8c6e7172 mark unreleased APIs as internal 2020-02-27 17:47:55 +05:30
Harendra Kumar
e966465af3 Align the export list of Prelude with Internal.Prelude 2020-02-27 16:54:29 +05:30
Harendra Kumar
a59c72cb86 remove duplication between exposed/internal modules
Keep the unreleased API documentation only in the internal module
2020-02-27 14:19:29 +05:30
Harendra Kumar
8766fbfdde Add concatM and fromCallback 2020-02-26 16:27:05 +05:30
Harendra Kumar
8293e2d2fe update comments 2020-02-26 16:27:05 +05:30
Harendra Kumar
17963a0a92 Add examples 2020-02-26 13:44:25 +05:30
Harendra Kumar
e799043bc6 Add teeZipWith
This could be useful to distribute the input two unfolds, transform each
part using a different transformation and then merge the ouputs in a
single stream.
2020-02-26 13:44:25 +05:30
Harendra Kumar
eccf24a4b1 Add singletonM, update some docs 2020-02-26 13:44:25 +05:30
Harendra Kumar
d96aedee1f Add zipWith 2020-02-26 13:44:25 +05:30
adithyaov
59509cd378 Fix lastN for n <= 0 2020-02-26 13:41:45 +05:30
Pranay Sashank
7f97e3bbe2 Add usingReaderT to Streamly.Internal.Prelude. 2020-02-24 18:06:54 +05:30
Pranay Sashank
3d884d4c1c Use fusion-plugin-types, not fusion-plugin for annotations. 2020-02-19 18:42:30 +05:30
Harendra Kumar
d38ab548f6 Fix GHC 7.10.3 build 2020-02-19 16:58:23 +05:30
Harendra Kumar
007df998b9 improve performance of foldable instance
* use foldl' based implementations of type class methods instead of
  using default implementations
* reimplement some type class methods to use INLINE pragmas
2020-02-19 16:58:23 +05:30
Harendra Kumar
b50e1a5285 Add benchmarks for Foldable and Traversable 2020-02-19 16:58:23 +05:30
Harendra Kumar
233ea77f03 change the signature of fromStrictMaybe and rename it
A pure function is a better building block than the monadic one.
2020-02-19 16:58:23 +05:30
Harendra Kumar
4eb53e7f86
Merge pull request #415 from hasufell/jospald/PR/network-3.0-build-fix
Fix build with network >= 3.0 && < 3.1 wrt #414
2020-02-18 20:22:01 +05:30
Julian Ospald
a343c4b99b Fix build with network >= 3.0 && < 3.1 wrt #414 2020-02-17 23:19:02 +01:00
Sanchayan Maity
bbfffe8e79 Streamly: Internal: Cleanup hlint warnings for Mutable and Network
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-02-16 18:23:05 +05:30
Sanchayan Maity
b1b0ae0ce7 Streamly: FileSystem: Cleanup FileSystem directory as per hlint suggestions
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-02-16 17:56:23 +05:30
Sanchayan Maity
dc7aad1501 Streamly: Memory: Cleanup Memory directory as per hlint suggestions 2020-02-16 17:56:23 +05:30
Sanchayan Maity
911242a7da Streamly: Data: Cleanup Data directory as per hlint suggestions 2020-02-16 17:56:23 +05:30
Pranay Sashank
d003fe5481 Fix example in demux documentation. 2020-02-13 12:20:59 +05:30
Harendra Kumar
4812ac3a57 Update docs of concatMapLoopWith et al. 2020-02-13 12:20:59 +05:30
Harendra Kumar
992206e3c4 Make buildable with ghcjs
Supply the fusion annotation type where fusion-plugin is not available.
2020-02-12 11:47:03 +05:30
Pranay Sashank
bd33fc7303 Start using fusion-plugin annotations. 2020-02-12 11:47:03 +05:30
Harendra Kumar
f8d7883a4f Fix inspection test failure for fromStreamVar 2020-02-12 10:30:48 +05:30
Harendra Kumar
54662d80c7 Add a predicate to pollCounts
The predicate provides more power to the combinator by allowing you to count
only certain elements in the stream and filter out others. This is efficient
compared to an async tap followed by a filter and fold as here filtering is
done on the source.
2020-02-10 16:09:16 +05:30
adithyaov
60d3f399d8 Relax version constraints for primitive to >= 0.5.4.0
Add Internal.Data.SmallArray.Types
Use Internal.Data.SmallArray.Types if primitive version is < 0.6.2.0
Modify Internal.Data.SmallArray accordingly
2020-02-10 13:00:33 +05:30
adithyaov
0cccb7fc79 Relax version constraints for primitive to >= 0.6.2.0
Add Internal.Data.Prim.Array.Types
Use Internal.Data.Prim.Array.Types if primitive version is < 0.6.4.0
Modify Internal.Data.Prim.Array accordingly
2020-02-10 13:00:33 +05:30
adithyaov
e14ad7b3d0 Add exact files for change comparision for SmallArray and PrimArray 2020-02-10 13:00:33 +05:30
Harendra Kumar
f6fd95a403 Use a predicate to control max sessions
A monadic predicate can be used to alert at different levels of session count
and to also eject sessions beyond a high watermark.
2020-02-09 13:31:45 +05:30
Harendra Kumar
5592064c83 Put an upper bound on the total number of sessions 2020-02-09 13:31:45 +05:30
Harendra Kumar
f1d30a1f8b Use the fold result to identify session termination
This affords the fold more power to abort based on some state e.g. it can
decide to abort the session if the event count in the session reaches a certain
maximum value.
2020-02-09 13:31:45 +05:30
Harendra Kumar
eea9aa1721 Fix time measurement issue
1) We were taking a max of the latest timestamp and the timer maintained time
   which is incorrect.

2) We were computing the timeout incorrectly making it twice the actual
   timeout.

Also, maintain sessionCount in the state. We will use this later to put a limit
of the number of sessions.
2020-02-09 13:31:45 +05:30
Harendra Kumar
98b4fc3c6f clear the finalizer from IORef on exception
on exception handling the finalizer was left installed in the IORef to be run
by GC, this could cause the finalizer to be run twice.
2020-02-04 18:25:00 +05:30
Harendra Kumar
19b5a6faf8 Reduce polymorphic code in fromStreamVar
Replace the polymorphic function "mkStream" with "MkStream" constructor
to avoid space leak due to a GHC issue when worker wrapper optimization
does not work.

See https://gitlab.haskell.org/ghc/ghc/issues/17745

Fixes #389
2020-02-01 00:52:01 +05:30
Harendra Kumar
753d091b75 Refactor currentTime, add comments, safety notes 2020-01-27 16:38:34 +05:30
adithyaov
50548138d6 Add currentTime and its benchmarks 2020-01-27 16:38:34 +05:30
Harendra Kumar
b19d96f174 Add todo comments, reorg imports 2020-01-26 13:49:05 +05:30
adithyaov
806364f302 Add readSlice in PrimArray 2020-01-25 15:53:10 +05:30
adithyaov
9bab836f6c Change module structure for PrimArray
Data.PrimArray -> Data.Prim.Array
2020-01-25 15:39:59 +05:30
adithyaov
912a1b9e1b Hide Streamly.Data.PrimArray
* Move Streamly.Data.PrimArray to other-modules
2020-01-25 15:39:57 +05:30
adithyaov
602011fb9a Modify NFData for PrimArray and expose Prim 2020-01-25 15:39:57 +05:30
adithyaov
f20540c24f Expose PrimArray from Internal 2020-01-25 15:39:56 +05:30
adithyaov
1f370ef67b Make Streamly.Internal.Data.PrimArray 2020-01-25 15:38:27 +05:30
Harendra Kumar
cffe711fac Fix the zip applicative performance
It got degraded after the previous mkParallel changes.
2020-01-25 15:32:27 +05:30
Harendra Kumar
a67e688c5d Use StreamD version of mergeBy in async merge
Now that we have StreamD version of mkParallel we should be able to use StreamD
version of merge efficiently.

Performance improved by 6x.
2020-01-25 15:32:27 +05:30
Harendra Kumar
a285b55ede Change mkParallel and mkAsync signatures
Use stream to stream transformation instead of returning a stream in the monad.
2020-01-25 15:32:27 +05:30
Harendra Kumar
a3c6ad334a improve doc and add named combinators for parallel apply 2020-01-25 15:32:27 +05:30
Pranay Sashank
b8178cd08f Fix copyright metadata in some modules.
Mainly, in
- Streamly.Internal.Data.Stream.StreamD
- Streamly.Internal.Data.Stream.StreamD.Type
- Streamly.Internal.Data.Unicode.Stream
2020-01-24 14:58:20 +05:30
Harendra Kumar
83acf91911 Add distributeAsync_
To tap a stream to multiple folds supplied in a container.
2020-01-24 03:41:48 +05:30
Harendra Kumar
a6f394c49a Update doc for async streams 2020-01-20 19:04:02 +05:30
Harendra Kumar
3f5c79ea94 Fix scheduling of WAsync style stream
We were scheduling it in the same manner as Async, instead we have to
schedule the actions from the two streams in a round robin fashion.

Fixes #371
2020-01-20 19:03:48 +05:30
Harendra Kumar
d35674ea02 Change the order of yld and stp continuations
The names were incorrect as per the definition of the type. This problem
occurred because the order of the arguments was changed at some point but we
missed changing these.
2020-01-19 22:15:05 +05:30
Harendra Kumar
a3c32bc716 Fix foldStreamSVar space leak
Use tail recursion in the worker loops. Run the work item under the saved
monadic state and restore the state after the work is done and before the next
work item is picked.

Benchmarks:

* asyncly/unfoldrM maxThreads 1
* wAsyncly/unfoldrM maxThreads 1
* aheadly/unfoldrM maxThreads 1
2020-01-19 14:19:16 +05:30
Harendra Kumar
37452d9ff9 Do not lose stream state in ahead stream
When executing a stream in ahead composition where we have composed multiple
streams using `ahead`, we are executing each element of the stream using the
fresh state from SVar at the fork point. This fix changes it such that we only
use the fresh state from SVar only at the start of stream execution and not for
each element of the stream. When yielding subsequent elements we have to carry
any state changes made when we yielded the previous elements.
2020-01-18 18:01:31 +05:30
Harendra Kumar
60cee489ae Add exception handling combinators with guaranteed cleanup
The "after", "finally" and "bracket" combinators did not run the "cleanup"
handler in case the stream is lazily partially evaluated e.g. using the lazy
right fold (foldrM), "Streamly.Prelude.head" is an example of such a fold.

Since we run the cleanup action when the stream Stops, the action won't be run
if the stream is not fully drained.

In the new implementation, we use a GC hook to run the cleanup action in case
the stream got garbage collected even before finishing. This will take care of
the lazy right fold cases mentioned above.
2020-01-18 15:02:34 +05:30
Harendra Kumar
c1cbe1896c mention left folds vs right folds 2020-01-16 02:20:17 +05:30
Harendra Kumar
290d2f6135 Make some updates to takeByTime/dropByTime
* Document the precise behavior, some changes were made to the earlier behavior
* Make some changes to implementation according to (newly) documented behavior
* TakeByTime: perform the time check before generating the element so that we
  do not drop an element after generation.
* TakeByTime now yields at least one element if the duration is non-zero
* dropByTime does not check the time after the drop duration is over
* Add inspection tests
* make the tests for shorter duration, earlier tests took too long
2020-01-16 02:02:37 +05:30
adithyaov
1979370373 Add takeByTime and dropByTime combinators 2020-01-16 02:02:37 +05:30
Harendra Kumar
83cbe5d14c Add distribute_ 2020-01-09 15:53:47 +05:30
Pranay Sashank
b05f7b43b4 Relax minimum bounds on containers.
- We should try to match any of the core libraries version bounds
with the min and max versions of ghc we support. This would allow
the users to use the library together with another one that uses
the ghc api with ease, preventing any possible version conflicts.
2020-01-06 13:06:57 +05:30
Pranay Sashank
57c2ddcc34 Strictify Fold accumulator in groupsOf & groupsOf2.
- Update Changelog.md to reflect the change in `chunksOf`.
2020-01-03 12:01:52 +05:30
Pranay Sashank
5b1da6b36a Update docs. 2020-01-03 11:54:32 +05:30
Pranay Sashank
e3a11ad9d9 Unhide haddock documentation for Internal modules. 2020-01-03 11:54:32 +05:30
adithyaov
5faf292267 Mv bemchmarks & change INLINABLE to INLINE - lastN
* Move benchmarks of lastN under serially/fold
* Changing INLINEABLE to INLINE on lastN allows fusion, increasing the perf
2020-01-02 16:51:43 +05:30
adithyaov
665e7df271 Add & use withForeignPtrM in Ring folds
* BUG fix
* Modified functions: unsafeFoldRingM & unsafeFoldRingFullM
* This does a touchForeignPtr to ringStart after the fold
2020-01-02 16:51:43 +05:30
adithyaov
5aa8e44d24 Add tests to lastN 2020-01-02 16:51:43 +05:30
adithyaov
46643d15b3 Add lastN combinator 2020-01-02 16:51:43 +05:30
Harendra Kumar
b83c2c28fc Add tapOffsetEvery to tap one in n elements 2019-12-31 02:07:02 +05:30
Harendra Kumar
5073377ba9 Add modular stream stats counting
* pollCounts to poll the element count in another thread
* delayPost to introduce a delay in polling
* rollingMap to compute diff of successive elements

These combinators can be used to compute and report the element
processing rate in a stream.
2019-12-31 00:22:41 +05:30
Harendra Kumar
135063fb0c use Prim Var instead of IORef 2019-12-30 19:56:31 +05:30
Harendra Kumar
9710c7b639 Change newVar signature, add modifyVar' 2019-12-30 19:56:31 +05:30
Harendra Kumar
4374014c94 Add fromPrimVar - generate a stream from a Prim Var 2019-12-30 19:56:31 +05:30
Harendra Kumar
97ecb28266 Add a mutable variable for Prim types 2019-12-30 19:56:31 +05:30
adithyaov
d6afd92d98 Add rollingHashFirstN, drainN and drainWhile 2019-12-30 15:57:34 +05:30
adithyaov
511fe85cc6 Use StreamD for iterate and iterateM 2019-12-30 15:37:03 +05:30
Harendra Kumar
c55d9395fe Do not expose the tapRate combinator yet 2019-12-27 23:44:33 +05:30
Pranay Sashank
d582037250 Add tapRate combinator.
- Also includes benchmarks for it.
2019-12-27 23:30:01 +05:30
Pranay Sashank
0d7dad84e4 Implement <*> and >> for SerialT via StreamD. 2019-12-27 12:47:53 +05:30