Commit Graph

778 Commits

Author SHA1 Message Date
Adithya Kumar
df5d1518d3 Non-Functional renaming changes in the array APIs
- Add pinned version of chunksOf
- Add documentation to pinned combinators
- Use the combinators with "pinned*" prefix over "*As" suffix
- Reduce the use of PinnedState
2023-07-28 00:51:14 +05:30
Adithya Kumar
3a3436c393 Use the pinned prefix over pinned suffix in array combinators
- Remove withNewArrayUnsafePinned (asPtrUnsafe can be used)
- Deprecate newPinned
2023-07-28 00:51:14 +05:30
Ranjeet Kumar Ranjan
aaa11613b2 Use non-threaded runtime for network tests on windows 2023-07-27 18:12:07 +05:30
Ranjeet Kumar Ranjan
efe0be398c Add benchmarks and property test for double Parser 2023-07-26 17:37:05 +05:30
Adithya Kumar
58b86c5281 Add a typeclass for serializing variable length types 2023-07-25 17:00:50 +05:30
Ranjeet Ranjan
eea1e0f634
Use all config options in Data.Stream.Concurrent tests (#1928)
Co-authored-by: Harendra Kumar <harendra@composewell.com>
2023-07-25 15:29:21 +05:30
Ranjeet Ranjan
afcc8ea59f
Implement double Parser (#2278)
Co-authored-by: Harendra Kumar <harendra@composewell.com>
Co-authored-by: Adithya Kumar <adithya@composewell.com>
2023-07-24 18:34:01 +05:30
Ranjeet Kumar Ranjan
69aa279c6c Import Data.Stream instead of Data.Stream.StreamD 2023-07-22 23:00:40 +05:30
Harendra Kumar
5e0307ae79 Import Parser instead of ParserD 2023-07-22 21:52:02 +05:30
Adithya Kumar
6a4d26b170 Rename Internal.Data.Unboxed to Internal.Data.Unbox 2023-07-20 16:54:29 +05:30
Ranjeet Ranjan
1ab2878eca
Expose groupsOf from Data.Stream (#2372) 2023-07-04 23:07:43 +05:30
Harendra Kumar
4ccd51c2b8 Remove MonadTrans/MonadBase instances for GHC >= 9.6
Remove MonadTrans/MonadBase instances for:

* ParallelT
* AsyncT
* WAsyncT
* AheadT

To accommodate a breaking change in transformers-0.6 .
2023-06-30 14:45:58 +05:30
Ranjeet Ranjan
8d7b837109 Build streamly with ghc-9.6.1 2023-06-29 08:41:03 +05:30
Ranjeet Kumar Ranjan
f1b5a212c5 Disable Linux event test using dev flag 2023-04-23 19:44:38 +05:30
Harendra Kumar
90b8467567 Fix build for concurrent stream test 2023-03-12 23:05:05 +05:30
Harendra Kumar
3cf59a6024 Disable some failing FileSystem.Event.Linux test cases 2023-03-11 20:30:25 +05:30
Harendra Kumar
8fe249da3b Fix new GHC warning 2023-03-10 23:22:12 +05:30
Ranjeet Ranjan
5946791774
Disable Windows hanging test cases (#2314) 2023-03-08 00:55:13 +05:30
Adithya Kumar
b5c79693fb Rename arraysOf to chunksOf 2023-03-06 17:19:25 +05:30
Ranjeet Kumar Ranjan
8240f5f870 Add multiple tests for the Unboxed typeclass
* Test for serialization
* Test for consistency with Generic deriving
2023-03-03 19:28:15 +05:30
Ranjeet Kumar Ranjan
5c9430a0ae Add test cases for Streamly.Internal.Serialize module 2023-03-02 17:11:14 +05:30
Harendra Kumar
d134ea3a56 Disable deintercalate tests 2023-03-02 16:22:32 +05:30
Harendra Kumar
635489ba7b Fix escape processing in wordWithQuotes
To escape characters in the same way as shell and to be able to specify
escape transliteration, and transliterate based on the type of quote.
2023-03-02 16:22:32 +05:30
Ranjeet Ranjan
34b2b49876
Rename mutable array type to MutArray (#2272) 2023-03-02 09:40:20 +05:30
Harendra Kumar
2d18f9eebd Expose decodeUtf8Chunks
Rename decodeUtf8Arrays* to decodeUtf8Chunks* to make it consistent with
other chunked stream operation names.
2023-03-01 23:09:38 +05:30
Harendra Kumar
5a81623427 Remove the chunked parser modules 2023-02-16 10:35:26 +05:30
Harendra Kumar
36bbd3bc1c Remove the rewrite rule based Parser wrapper layer
Now we have explicit "Parser" and "ParserK" types for direct style and
CPS parsers, respectively. The programmer can use either type depending
on the use case.
2023-02-10 11:48:18 +05:30
Ranjeet Kumar Ranjan
8629a0e806 Fix test cases for StreamD/StreamK split up 2023-02-06 22:09:46 +05:30
Harendra Kumar
dabe66ceaa Fix test and benchmarks for concurrent module changes 2023-01-13 16:44:36 +05:30
Harendra Kumar
3c3ec6de48 Make minor refactor/cleanup changes to array code
* Use defaultChunkSize in tests from Streamly.Internal.System.IO module
2023-01-10 23:45:41 +05:30
Adithya Kumar
96a7c99708 Use Proxy type in the sizeOf method of Unbox 2023-01-09 13:05:06 +05:30
Ranjeet Ranjan
deb16f8670
Add test cases for Unbox Generic derived instances (#2207)
Co-authored-by: Harendra Kumar <harendra@composewell.com>
2023-01-07 19:05:30 +05:30
Ranjeet Ranjan
030499eb7e
Fix dev flag build, test, benchmarks issues (#2206)
* Fix dev flag build, test, benchmarks issues
* Add no-charts flag when compiling bench-report

Co-authored-by: Harendra Kumar <harendra@composewell.com>
2023-01-07 14:32:31 +05:30
Adithya Kumar
f7f264fefd Remove Storable constraint from Unbox typeclass 2023-01-06 00:14:45 +05:30
Harendra Kumar
133e20addb Fix test targets and heap for generic array 2022-12-30 19:03:28 +05:30
Harendra Kumar
94f3134643 Change the argument order of put/modifyIndex 2022-12-30 19:03:28 +05:30
Harendra Kumar
6ca9d80006 Refactor Fold.Container and expose some container ops
Make the container operations less polymorphic.
2022-12-28 17:21:48 +05:30
Ranjeet Kumar Ranjan
666eb07493 Rename ParserChunked to ChunkParser 2022-12-11 00:31:29 +05:30
Ranjeet Ranjan
45e21892bc
Rename unicode internal modules (#2164) 2022-12-11 00:23:43 +05:30
Harendra Kumar
10b1ac12a9
Use Either result in parse ops in Chunked stream/Producer (#2145)
Co-authored-by: Ranjeet Kumar Ranjan <ranjeetr@composewell.com>
2022-12-06 16:52:56 +05:30
Ranjeet Ranjan
001b874234
Rename rights, lefts, both to catRights, catLefts, catEithers (#2139)
Co-authored-by: Harendra Kumar <harendra@composewell.com>
2022-12-01 16:28:37 +05:30
Ranjeet Kumar Ranjan
3a21b44607 Make parser result type either everywhere
* Change remaining parse/parseBreak/parseIterate functions
* Fix benchmarks
* Fix tests
2022-11-25 19:09:34 +05:30
Harendra Kumar
8c8b9c34ee Remove the Monad instance from SerialT/Stream type
Transfer the removed instances to the CrossStream type.
2022-11-20 17:20:06 +05:30
Harendra Kumar
4f862664f9 Improve performance of the chunked parser
Pass around the original unchanged array instead of reconstructing the
array every time the bounds change.

Remove the specialized handling of the Alternative case.
2022-11-17 16:49:25 +05:30
Harendra Kumar
fe28607c9e Add a chunked parser implementation 2022-11-17 16:49:25 +05:30
Harendra Kumar
d7d4613a27 Prefix par to concurrent APIs
So that we can import these along with the normal/serial streaming APIs
and distinguish them clearly.
2022-11-17 11:57:03 +05:30
Ranjeet Kumar Ranjan
297574d7f1 Rename Array.Stream module to Stream.Chunked 2022-11-15 15:18:38 +05:30
Adithya Kumar
5a9eab8528 Rename append(N) to writeAppend(N) in unboxed arrays 2022-11-07 19:11:45 +05:30
Adithya Kumar
0d3c63aeae Rename serialWith to splitWith 2022-11-07 19:11:27 +05:30
Ranjeet Kumar Ranjan
4eda9d0c1f Rename Data.Array.Unboxed 2022-11-04 16:00:48 +05:30
Ranjeet Kumar Ranjan
64d337474b Move Data.Array to Data.Array.Generic 2022-11-04 16:00:48 +05:30
Adithya Kumar
239e3311eb Change "Parser m a b" to "Parser a m b" 2022-11-03 04:28:59 +05:30
Harendra Kumar
703823b3d5 Update Fold docs, move containers ops to streamly pkg
Move the container dependent code from streamly-core to streamly
Rename some functions.
Release some functions.
2022-11-02 20:25:26 +05:30
Adithya Kumar
41fb0734bc Use explicit arguments in the concurrency config options 2022-10-27 15:32:41 +05:30
Adithya Kumar
1fb51c42ae Replace Unboxed with Unbox and remove the Unboxed type alias 2022-10-27 01:11:34 +05:30
Adithya Kumar
64aa13dfd6 Use Bool instead of Switch 2022-10-26 23:02:28 +05:30
Adithya Kumar
5327f181db Deprecate Streamly.Prelude & S.Internal.Data.Stream.IsStream.* 2022-10-21 02:07:24 +05:30
Harendra Kumar
e8564258ec
Change the unfold/toStream naming for arrays (#2004) 2022-10-20 20:12:37 +05:30
Harendra Kumar
e03cceb344
Change Handle, Stdio, File unfold APIs (#1998) 2022-10-20 17:27:02 +05:30
Harendra Kumar
3db9238be1 Add stream ops, deprcate/rename unfold ops (Network)
Add internal stream generating operations as alternatives to unfolds. Stream
operations are for common use. Unfolds are for optimizations in nested
use.

Rename the unfold operations from "read*" to "reader*". The "read*'
operations will be used for stream operations in future.
2022-10-20 04:58:22 +05:30
Harendra Kumar
f7415e9b44 Use list based concat functions in place of binary ops 2022-10-17 16:31:34 +05:30
Harendra Kumar
362ceb1e39 Rename eagerEval to eager and inspectMode to inspect 2022-10-16 20:18:16 +05:30
Harendra Kumar
bfec356951 Implement "interleaved" config option
For concurrent streams.
2022-10-16 20:02:37 +05:30
Harendra Kumar
d3ec4917d9 Revert "Split Serial module into Serial and WSerial"
This reverts commit 5ddfb45764.
2022-10-13 01:27:53 +05:30
Ranjeet Ranjan
7ac9ab7d5b
Rename Data.Stream.Async to Data.Stream.Concurrent (#1926) 2022-10-11 16:41:45 +05:30
Harendra Kumar
edc9d3ad8f Add the ordered option in Async tests 2022-10-11 00:23:09 +05:30
Harendra Kumar
18e656ff95 Add eagerEval option in Async tests 2022-10-10 18:20:44 +05:30
Ranjeet Ranjan
666dbb0bdb
Change the signature of Parser.sequence, move fold at end (#1906) 2022-10-07 13:53:17 +05:30
Ranjeet Ranjan
61eb3f4dfa
Change the signature of Parser.deintercalate, move fold at end (#1904) 2022-10-07 13:51:50 +05:30
Adithya Kumar
ba01fcd958 Rename and move unboxed array APIs
Added Unboxed.newUnpinnedBytes and Mut.Type.newUnpinned

Array.Unboxed.Mut.Type.nilArrayContents -> Unboxed.nil
Array.Unboxed.Mut.Type.newAlignedArrayContents -> Unboxed.newAlignedPinnedBytes

Mut.Type:
newArray -> newPinned
newArrayAligned -> newAlignedPinned

Unboxed:
newUnpinnedArrayContents -> newUnpinnedBytes
2022-10-07 11:37:50 +05:30
Adithya Kumar
83ed97646c Add tests for the existence of Unbox type class instances 2022-10-06 21:00:50 +05:30
Adithya Kumar
6e021ceb18 Change the signature of replicateM 2022-10-06 15:17:46 +05:30
Ranjeet Ranjan
05eb489fd3
Rename head to one (#1887) 2022-10-04 17:00:29 +05:30
Ranjeet Ranjan
4ab5ba2ce9
Rename *.Foreign to *.Unboxed modules in streamly-core (#1877) 2022-10-03 18:24:31 +05:30
Adithya Kumar
d84f82d973 Remove redundant GHC 8.8 CPP conditional 2022-09-30 15:28:24 +05:30
Adithya Kumar
09ed99de1f Remove support for GHC 8.4.* 2022-09-28 17:50:58 +05:30
Adithya Kumar
99846a8f07 Remove the primitive dependency from streamly-core 2022-09-22 01:49:06 +05:30
Harendra Kumar
8a0d9ad39f Add test for new Async streams 2022-09-20 18:40:00 +05:30
Adithya Kumar
e3e60caeaa Update the Unboxed representation
1. Use sizeOf and alignment from Storable
2. Rename readByteArray -> box and writeByteArray -> unbox
3. Rename ArrayContents to MutableByteArray
4. Change the meaning of the typeclass and update the docs accordingly
2022-09-01 17:50:55 +05:30
Harendra Kumar
68dccf50a7 Bump dependency upper bounds for GHC 9.4
Bump base upper bound
Bump lockfree-queue upper bound
2022-08-28 01:37:46 +05:30
Harendra Kumar
b8a17190a8
Implement ZipStream using Data.Stream (#1811) 2022-08-25 23:57:42 +05:30
Ranjeet Ranjan
6e77cdbe24
Move SmallArray to dev flag (#1783) 2022-08-25 15:52:41 +05:30
Ranjeet Ranjan
0b4a300f1a
Combine test-core and bench-core flags to a single use-streamly-core flag (#1798) 2022-08-23 11:47:20 +05:30
Ranjeet Ranjan
64e471b91a
Move unboxed array tests under test-core flag (#1797) 2022-08-22 22:01:50 +05:30
Harendra Kumar
8dd618b1ba Increase heap limit for building Parser tests 2022-08-20 23:05:13 +05:30
Harendra Kumar
8e03301862 Add tests for Alternative instance of ParserD 2022-08-20 23:05:13 +05:30
Harendra Kumar
c0769668d9 Change the type of parser "extract" to Step 2022-08-20 23:05:13 +05:30
Ranjeet Ranjan
a40431740c
Replace SerialT with Stream for remaining modules (#1777)
* Replace SerialT to Stream for remaining modules

* Reduce the usage of IsStream in benchmarks

And some other refactoring.

Co-authored-by: Harendra Kumar <harendra@composewell.com>
2022-08-20 11:13:11 +05:30
Ranjeet Ranjan
ec760805c9
Modularize test cases (#1707)
* Modularize test cases

* Make it build with test-core flag

And several other changes.

Co-authored-by: Harendra Kumar <harendra@composewell.com>
2022-08-20 00:45:57 +05:30
Ranjeet Kumar Ranjan
18a226b9f0 Array.Foreign -> Array.Unboxed in tests and benchmarks & intenals
Co-authored-by: Ranjeet <ranjeet@composewell.com>
2022-08-17 15:09:42 +05:30
Harendra Kumar
ffb1dfcc90 Update default.nix for bench/test-runner 2022-08-09 01:59:59 +05:30
Harendra Kumar
af9e344557 Remove stale Prim Array targets from test-runner 2022-08-09 01:59:59 +05:30
Harendra Kumar
9ed94a6a09 Implement many2, map2
* crossWith and many can be implemented in terms of many2
* rename mapmWithInput to mapM2
* add map2
2022-08-07 13:25:40 +05:30
Ranjeet Kumar Ranjan
26b78c6e89 Deprecate Streamly.Data.Array.Foreign module
Rename it to Streamly.Data.Array.Unboxed
2022-08-06 00:38:23 +05:30
Ranjeet Kumar Ranjan
3dc72698cf Replace SerialT with Stream 2022-07-31 02:48:10 +05:30
Adithya Kumar
4015d54128 Remove prim arrays and all related code 2022-07-31 02:43:44 +05:30
Adithya Kumar
3d8ffee684 Fix the test case for Parser.takeFramedByEsc_ 2022-07-27 17:43:18 +05:30
Adithya Kumar
3811e683ce Improve array combinators to work with unpinned arrays 2022-07-27 17:24:59 +05:30
Harendra Kumar
c366e2d5e2 Use unfolds in all stream generation ops
Based on a build flag. We want to benchmark how these operations perform
when unfolds are used. This is to investigate if we can replace these
ops with just unfolds or implement these in terms of unfolds to improve
modularity.

Increase memory for Split benchmarks for use-unfolds flag.
2022-07-19 02:45:34 +05:30
Adithya Kumar
aaa279c9b2 Add tests for unboxed ring array 2022-07-11 18:51:43 +05:30
Adithya Kumar
c361a315e3 Add some test cases for unboxed array 2022-07-08 16:51:03 +05:30
Ranjeet Kumar Ranjan
8ac1ad15c2 Implement nub as Fold 2022-07-04 17:55:33 +05:30
Adithya Kumar
3e76123e53 Add couple of test cases for foreign mutable array 2022-06-30 17:51:39 +05:30
Adithya Kumar
adc2e75b5d Abstract out Unboxing helpers and comment out IOVec code 2022-06-23 16:09:57 +05:30
Adithya Kumar
0d2ce6ca76 Deprecate variance and stdDev in folds 2022-06-11 19:18:01 +05:30
Adithya Kumar
1ee11e87ec Increase the build memory limit for test:Data.Parser 2022-06-09 21:55:06 +05:30
Adithya Kumar
f3b07c2922 Add an option to preserve quotes in wordQuotedBy 2022-06-09 21:55:06 +05:30
Harendra Kumar
d36f02ff12 Implement min/max/range without dequeue 2022-06-09 16:46:13 +05:30
Ishan Bhanuka
9d68f58a21 Implement concatSequence for parser
concatSequence collects sequential parses of
parsers in a serial stream using a fold.

* Wrapper and internal implementation
* Benchmark and tests
* Documentation update
2022-05-30 12:07:09 +05:30
Harendra Kumar
2aae2da54c Add Word8 stream splitting tests 2022-05-29 00:29:39 +05:30
Ranjeet Kumar Ranjan
509fc06729 Fix takeFramedByEsc_ test case 2022-05-28 23:58:02 +05:30
Harendra Kumar
e715e4a115 Rename fold_/parse_/foldOn
fold_ to foldBreak
foldOn to foldContinue
parse_ to parseBreak

Use Parser instead of ParserD in parseBreak API
2022-05-19 23:57:56 +05:30
Harendra Kumar
420f387a20 Deprecate the "next" parser, use "one" fold instead 2022-05-19 23:26:49 +05:30
Ranjeet Kumar Ranjan
93e33d3292 Add parser tests cases
* takeEndBy
* takeEndByEsc
* takeFramedByEsc
* takeStartBy_
2022-05-12 16:59:07 +05:30
Harendra Kumar
9e034c738e Add takeWhileP test 2022-05-09 13:02:49 +05:30
Harendra Kumar
6ed0c935c5 Rename some parser APIs, reorg the export list
And add some proposed commented APIs.
2022-05-08 10:51:52 +05:30
Harendra Kumar
0409d4bbec Add a test for deintercalate 2022-05-06 16:51:30 +05:30
Harendra Kumar
e4418a5f06 Fix dependencies and package names
For bench-runner and test-runner
2022-05-06 16:51:30 +05:30
Harendra Kumar
b7b3aa8d02 Rename benchmark driver exe to bench-runner
To keep it consistent with test-runner for test driver
2022-04-28 23:35:26 +05:30
Harendra Kumar
5435aa1b16 Use Haskell based test driver
Replace bin/test.sh with a Haskell implementation
2022-04-28 23:13:45 +05:30
Ranjeet Kumar Ranjan
a849812d99 Maintain a list of top w elements in the stream 2022-04-22 19:55:41 +05:30
Ranjeet Kumar Ranjan
8569fdd383 Fix test case for takeBetween 2022-04-21 19:30:57 +05:30
Harendra Kumar
02578386da Use the demux input to determine the fold
We may want to use the entire value to determine the fold and not just
the key. For example, we may have the key as an Int that uniquely
determines the fold (for example a connection/request id). Once the
fold starts we can always lookup the fold using this key. However, to
determine what fold to use initially we may need more information than
just the request-id (e.g. the type of the message).
2022-04-11 18:41:37 +05:30
Adithya Kumar
5b135b5bfe Symlink a few moved dev files 2022-04-11 01:16:09 +05:30
Adithya Kumar
72a0199c67 Move the README of benchmarks and tests into the developer docs 2022-04-11 01:16:09 +05:30
Harendra Kumar
800ae8a8f8 Use monadic action to generate fold in demux* 2022-04-06 17:43:15 +05:30
Ranjeet Kumar Ranjan
d31f3329f1 Rename some unfold APIs 2022-04-06 17:41:47 +05:30
Ranjeet Kumar Ranjan
4f70b0d4e6 Rename Socket BufferOf APIs 2022-04-03 15:30:56 +05:30
Harendra Kumar
6b2f1c1669 Change demux fold APIs and implementations 2022-04-02 03:32:42 +05:30
Ranjeet Kumar Ranjan
7886550a71 Add bubbleAsc function
Fix review comments

Fix last element

Fix empty arraay check
2022-04-01 14:40:43 +05:30
Ranjeet Kumar Ranjan
3a59974ed8 Rename unfold scan to postscan, add benchmark, test 2022-03-25 15:18:27 +05:30
Ranjeet Kumar Ranjan
3b3bda74fb Add a test for Fold.postscan
Fix review comments

Fix review comments
2022-03-25 15:09:57 +05:30
Ranjeet Kumar Ranjan
af68c08a71 Rename some filesystem APIs 2022-03-25 14:04:00 +05:30
Harendra Kumar
0eadd04ada Add doc, powersums and mean
Rename "whole" to "cumulative"
2022-03-25 12:33:58 +05:30
Ranjeet Kumar Ranjan
f95fcbd82f Add a module for sliding window folds
Moved some basic incremental folds from 'streamly-statistics" package.
2022-03-25 12:33:58 +05:30
Ranjeet Kumar Ranjan
e0cf3aa3cf Add test case for Fold.scan 2022-03-25 00:17:32 +05:30
Harendra Kumar
5ddfb45764 Split Serial module into Serial and WSerial 2022-03-24 12:55:08 +05:30
Harendra Kumar
cc7ac6cad9 Remove remaining code meant for GHC < 8.4 2022-03-24 02:24:27 +05:30
Ranjeet Kumar Ranjan
07bf70d5f8 Drop GHC 8.x to 8.2.x Support 2022-03-24 02:23:45 +05:30
Ranjeet Kumar Ranjan
1b8043f6ef Fix joinOuter 2022-03-24 02:19:44 +05:30
Ranjeet Kumar Ranjan
3012ae95e5 Change the argument order of Unfold.many 2022-03-19 11:49:15 +05:30
Harendra Kumar
f8afdaf7e2 Fix docspec for Data.Fold 2022-03-14 11:47:42 +05:30
Ranjeet Kumar Ranjan
faabb9a01f Add mutable array "strip" operation 2022-03-14 02:29:41 +05:30
Ranjeet Kumar Ranjan
4b49390286 Fix uniqBy and rollingMap
Fix hlint

Fix review comments

Add Functor contraint

Fix review comments
2022-03-11 13:46:05 +05:30
Adithya Kumar
29ba5decc5 Extract streamly-core out of streamly 2022-03-10 01:25:49 +05:30
Adithya Kumar
064b1d9db7 Rename unsafeCast as castUnsafe 2022-03-07 03:54:51 +05:30
Ranjeet Kumar Ranjan
f30eafd440 Add -Wmissing-export-lists flag 2022-03-01 13:41:50 +05:30
Ranjeet Kumar Ranjan
e65c5db97e Add a takeEndBy transformation
Fix review comments

Fix review comments

Use fromStreamD and toStreamD instead of fromStreamS and add a test case

Move test case to Common

Fix hlint
2022-02-28 17:26:51 +05:30
Ranjeet Kumar Ranjan
64e9eeafc5 Add test cases for async 2022-02-11 03:59:34 +05:30
Ranjeet Kumar Ranjan
4d4732577d Add a test for wAsync behavior check 2022-02-11 03:59:34 +05:30