Commit Graph

964 Commits

Author SHA1 Message Date
Harendra Kumar
517c3b7a23 Implement a 'Pipe' type 2019-06-07 09:34:23 +05:30
Harendra Kumar
b1106ffcc9
Merge pull request #194 from composewell/misc-fixes
Fixes for iterateM, uniq, fromIndicesM
2019-06-03 07:43:42 +05:30
Harendra Kumar
cfd77bd7da Fix lchunksOf missing one item between chunks 2019-06-03 07:16:59 +05:30
Harendra Kumar
1192c130e2 Add array transform/fold operations
* Fix a negative count bug in toArrayMinChunk
* Add error messages when negative counts are passed to functions that accept a
  count of elements/size.
2019-06-02 09:42:36 +05:30
Harendra Kumar
d0bba7667b Add toArray fold to fold a stream into a single array 2019-06-02 05:36:02 +05:30
Harendra Kumar
3ce574aa53 implement covariant mapM/sequence for Fold
Also add some missing INLINE
2019-06-02 05:17:22 +05:30
Harendra Kumar
f767cf5f5d use bracket instead of finally for better perf
finally in fromSocket seems to perform worse than using bracket in "withSocket"
style.
2019-06-02 05:14:10 +05:30
Harendra Kumar
b604937edb update some notes/doc on exception handling 2019-06-02 05:07:59 +05:30
Pranay Sashank
4ac4891a23 Update Changelog. 2019-06-01 22:00:04 +05:30
Pranay Sashank
218b48a1a3 Add benchmarks for fromIndices and fromIndicesM. 2019-06-01 22:00:04 +05:30
Pranay Sashank
7758b1198c Add Rewrite rule to fromIndicesM for Serial streams. 2019-06-01 22:00:00 +05:30
Pranay Sashank
64524bf4f6 Make fromIndicesM concurrent, and add tests for fromIndicesM. 2019-06-01 21:49:08 +05:30
Pranay Sashank
e6699ece2f Fix a bug in uniq function. Fixes #191. 2019-06-01 21:49:08 +05:30
Pranay Sashank
6ed211f28a Changes the signature of iterateM. Fixes #190.
Now, iterateM is
(IsStream t, MonadAsync m) => (a -> m a) -> m a -> t m a
2019-06-01 21:49:08 +05:30
Harendra Kumar
a2fd0dc488 Add toArrays fold 2019-06-01 10:34:16 +05:30
Harendra Kumar
63ce5d95ba Add lchunksOf and lsessionsOf 2019-06-01 09:38:32 +05:30
Harendra Kumar
2eb8bb8e22 Add INLINEs and fix perf degradation due to exception handling 2019-06-01 04:39:47 +05:30
Harendra Kumar
b70a369ccd Add append example 2019-06-01 04:11:57 +05:30
Harendra Kumar
260e31d4cd Add INLINE pragma to encode/decode routines 2019-06-01 04:10:53 +05:30
Harendra Kumar
22ccf96a17 Add withSocket, add networking examples to cabal file 2019-05-31 15:01:14 +05:30
Harendra Kumar
0ae75fb48e Add missing Server module 2019-05-31 14:17:50 +05:30
Harendra Kumar
7f4c6859b9 Export the Fold constructor via the Internal module 2019-05-31 14:16:48 +05:30
Harendra Kumar
81d8c27b31 Add the Network.Client module 2019-05-31 14:06:58 +05:30
Harendra Kumar
a2e76766c3 Split the server combinators in a separate module 2019-05-31 12:43:26 +05:30
Harendra Kumar
e347812091 inline the exception functions 2019-05-31 09:52:09 +05:30
Harendra Kumar
fc6d77a025 Fix a performance issue with File.read
We were using bracket on a loop which iterates very frequently. Instead use it
on an outer loop which is much leass frequent.

Also add FileIO.hs to test drive the performance of FileIO APIs.
2019-05-31 09:49:32 +05:30
Harendra Kumar
e19003266d rename FileIO.hs example file to HandleIO.hs 2019-05-31 09:46:53 +05:30
Harendra Kumar
2b120d2445 fix file-io example to use Handle module 2019-05-30 13:10:28 +05:30
Harendra Kumar
75ef6c21c1 sync server example with changes in the library
Use the file API instead of handle API
2019-05-30 12:10:37 +05:30
Harendra Kumar
610941f8ed Expose splitSuffixBy' 2019-05-30 12:09:55 +05:30
Harendra Kumar
9e2e7650e0 Add file path based APIs to read/write/append to files 2019-05-30 11:39:42 +05:30
Harendra Kumar
606fe9de74 rename FileSystem.File module to FileSystem.Handle 2019-05-30 08:31:24 +05:30
Harendra Kumar
677c94d867 Simplify connections' stream API, add fromSocket 2019-05-30 06:39:48 +05:30
Harendra Kumar
8857b64a2e reorganize, add exception handling, network IO 2019-05-30 01:06:32 +05:30
Harendra Kumar
03f9157f9c update changelog 2019-05-30 00:28:49 +05:30
Harendra Kumar
0663aebe55 Add char8 string encoding/decoding routines 2019-05-30 00:19:30 +05:30
Harendra Kumar
68690bb4ed update client/server examples 2019-05-29 09:59:05 +05:30
Harendra Kumar
d50214ab30 Add some todo notes/combinator definitions 2019-05-29 09:58:39 +05:30
Harendra Kumar
523f606faf Add exception handling combinators 2019-05-29 09:58:08 +05:30
Harendra Kumar
68d2bf885c Add parallel stream stop styles
End the composed stream:
* when the first stream ends
* when any constituent stream ends (race)

The first one is useful to compose an infinit stream with a finite stream. For
example we implement the insperseByTime combinator using it which in turn is
used to implement the sessionsOf comibnator that folds the stream in chunks of
time.
2019-05-28 10:14:51 +05:30
Harendra Kumar
f1e2f03766 update and add networking examples 2019-05-28 10:13:35 +05:30
Harendra Kumar
0eecbb5418 Add wSerial combinator variants to control end-of-stream
We now have better control over when to end the composed stream i.e.

* when both ithe input streams end
* when any input stream ends
* When a specific input stream ends
2019-05-28 04:54:58 +05:30
Harendra Kumar
a5d7b2f44b fix ghc-8.0 stack build 2019-05-28 03:38:31 +05:30
Harendra Kumar
65a08a2795 update packcheck CI script version 2019-05-28 02:38:58 +05:30
Harendra Kumar
07f6c8aaba Export concatMapBy 2019-05-28 01:46:43 +05:30
Harendra Kumar
fd3d4e52ac Fix GHC-7.10 build 2019-05-28 01:34:22 +05:30
Harendra Kumar
52a4b4a3c4 Add a reminder note 2019-05-28 00:12:29 +05:30
Harendra Kumar
9353c2f263 Fix build for GHC 7.10 and 8.0
GHC 7.10 does not seem to like RULES closing brace on the first column.
2019-05-27 23:58:07 +05:30
Harendra Kumar
1949eb90af Concurrent concatMap, foldr/build fusion, benchmarks
* Implement a stream flavor specific (concurrent/wSerial etc.) concatMap
  (concatMapBy). Now concatMap has the same capabilities that the monad bind of
  different streams has. In fact the monad bind is implemented using concatMap

* Use foldr/build fusion for concatMap (currently disabled) and for map/fmap
  and mapM (enabled)

* Add benchmarks for bind/concatMap performance
2019-05-27 23:29:21 +05:30
Harendra Kumar
7a232eb3c7 fix network module version 2019-05-27 07:48:59 +05:30