Commit Graph

2800 Commits

Author SHA1 Message Date
Harendra Kumar
06e55120ce Rename Consumer to Refold
Consumer is a very generic name. One cannot intuitively distinguish
between Consumer and Fold. "Refold" gives a better idea that its a
slightly modified version of Fold with a starting value. Also, it fits
better as a dual to Unfold.
2021-10-22 01:34:02 +05:30
Harendra Kumar
7029f6fd49 Add appendConsumer 2021-10-22 01:32:50 +05:30
Harendra Kumar
28fe29b9f7 Add iterate and append 2021-10-22 01:32:50 +05:30
Harendra Kumar
f393b15fc5 Add foldOn 2021-10-22 01:24:58 +05:30
Harendra Kumar
a096f77c3e Round up space to 4K for large objects
In shrinkToFit. Also, rename shrinkToFit to rightSize.
2021-10-22 01:18:56 +05:30
Harendra Kumar
8f467a43fa Refactor splice ops, change behavior of splice
This fix changes the behavior of "splice". The older version failed if
there was no free space in the destination array. The new version
reallocates to ensure the required space.
2021-10-22 01:17:21 +05:30
Harendra Kumar
09ec14b9ab Fix performance issue in snoc, add snocLinear
The earlier version reallocated the array on each new element addition
which is terribly inefficient. The new implementation increases the
array size by doubling the previous size when reallocation is needed.

snocLinear increases it by fixed chunk size instead.
2021-10-22 01:15:17 +05:30
Harendra Kumar
29ea7b10e7 Factor out a low level func from snocUnsafe
This is to be used elsewhere later on.
2021-10-22 01:13:53 +05:30
Harendra Kumar
3d5cd85c6c Refactor getIndexUnsafe, putIndexUnsafe
Variable renaming, add an assert.
2021-10-22 01:13:53 +05:30
Harendra Kumar
3b827052b0 Rename toArrayMinChunk to writeWith 2021-10-22 01:13:53 +05:30
Harendra Kumar
0d6a0aa943 Rename unsafeIndex and unsafeWriteIndex
To getIndexUnsafe and putIndexUnsafe.
2021-10-22 01:13:53 +05:30
Harendra Kumar
fff2704282 Rename spliceWith and spliceWithDoubling
To simply splice and spliceExp (exponential growth).
2021-10-22 01:13:53 +05:30
Harendra Kumar
b5b5d9bf9e Rename unsafeSnoc to snocUnsafe 2021-10-22 01:13:53 +05:30
Harendra Kumar
0a8689c587 Add todos for monadic mutable APIs 2021-10-22 01:13:53 +05:30
Harendra Kumar
e870b5cdb7 Assert length is multiple of elemSize 2021-10-22 01:13:53 +05:30
Harendra Kumar
f700973876 Use modular functions to implement fromStreamD
Write it in terms of arrayStream building blocks.
2021-10-22 01:13:53 +05:30
Harendra Kumar
f54686b50b Add a todo comment about rewrite rules in fromStream 2021-10-17 16:39:07 +05:30
Harendra Kumar
1232ae095a Fix integer comparison issue for quick mode 2021-10-17 16:37:09 +05:30
Harendra Kumar
5925c4437c Remove Eq and Show instances for mutable arrays
Changes to the array comparison function:
* Make array comparison function monadic
* In the compare function compare pointers when lengths are equal
2021-10-17 15:11:47 +05:30
Harendra Kumar
01643fe7f9 Add array casting operations for mutable arrays 2021-10-15 17:50:10 +05:30
Harendra Kumar
11ad72a6bd Rename mutableArray to fromForeignPtrUnsafe 2021-10-15 17:49:06 +05:30
Harendra Kumar
3a4e9163ea Add some asserts, update docs 2021-10-15 17:49:06 +05:30
Harendra Kumar
c48ef0464b Improve NFData instance
This would make the comparison with prim arrays fairer.
2021-10-15 17:49:06 +05:30
Harendra Kumar
a464be5d3a Simplify many/manyPost 2021-10-15 14:15:31 +05:30
Harendra Kumar
3201dc8328 Add consumeMany benchmark 2021-10-12 20:50:29 +05:30
Harendra Kumar
5342b1629f Add consumeIterateM benchmark 2021-10-12 20:50:29 +05:30
Harendra Kumar
6006084cff Add foldl' and sconcat consumers 2021-10-12 20:50:29 +05:30
Harendra Kumar
2d9654f229 Add rmapM to Consumer module 2021-10-12 20:50:29 +05:30
Harendra Kumar
0548e36d51 Rename Transformation1 benchmark module
to Transformation
2021-10-12 20:46:49 +05:30
Harendra Kumar
4179a3bdf2 Rename Transformation2 benchmark module to NestedFold 2021-10-12 20:46:49 +05:30
Harendra Kumar
55758dd5b7 Rename Nested benchmark module to NestedStream 2021-10-12 20:46:49 +05:30
Harendra Kumar
8dc51e8b05 Move Transformation3 benchmark module to Lift 2021-10-12 20:46:49 +05:30
Harendra Kumar
69aa9b3209 Add consumeIterateM 2021-10-12 20:44:26 +05:30
Harendra Kumar
a46c7bf6a9 Make the type of Consumer similar to Fold 2021-10-12 20:37:14 +05:30
Harendra Kumar
9738b4b73e Move Fold Step to a separate module 2021-10-12 20:37:14 +05:30
Harendra Kumar
f3c31f0385 Add build/test/bench instructions
Move the design related docs out to a separate doc in "dev" dir.
2021-10-12 18:57:14 +05:30
Harendra Kumar
b4f6e6e860 Add a --quick option
--quick disables optimizations during build.
2021-10-12 18:57:14 +05:30
Harendra Kumar
ea23678754 Rename Fold2 to Consumer 2021-10-12 18:25:47 +05:30
Harendra Kumar
3cda01f5da Move Fold2 to a separate "Consumer" module 2021-10-12 18:25:47 +05:30
Harendra Kumar
726d356bf7 Fix the doc for foldSequence 2021-10-10 14:17:06 +05:30
Harendra Kumar
58b7b77857 Make the seed in foldIterateM monadic 2021-10-10 14:17:06 +05:30
Harendra Kumar
28d9965391 Add a note about unfold/fromList fusion 2021-10-10 14:14:58 +05:30
Harendra Kumar
7711796f55 Add a scan skeleton for unfolds 2021-10-10 14:14:58 +05:30
Harendra Kumar
5ed2212d6d Fix doctest in "last" 2021-10-10 11:34:25 +05:30
Harendra Kumar
fadf51a217 Rename runStep to snoc, add finish, update docs 2021-10-10 11:34:25 +05:30
Harendra Kumar
cd29e5e2df Add toStreamK and toStreamKRev 2021-10-10 11:34:25 +05:30
Harendra Kumar
0f3e545d0e Add scan skeleton for folds 2021-10-10 10:24:10 +05:30
Harendra Kumar
209433807f Rename unsafeSlice to getSliceUnsafe 2021-10-09 22:59:01 +05:30
Harendra Kumar
58051d0cbf Add some unimplemented functions 2021-10-09 22:59:01 +05:30
Harendra Kumar
92738b9dcf Remove the use of "length" in some impls
length is costly because of an expensive div operation.
2021-10-09 22:59:01 +05:30