Commit Graph

1250 Commits

Author SHA1 Message Date
Harendra Kumar
51f12c9d22 Use unfolds to read from file handles 2019-10-15 00:40:15 +05:30
Harendra Kumar
bf5e153bf5 rename Handle readArrays* APIs to toStreamArrays* 2019-10-15 00:40:15 +05:30
Harendra Kumar
8dadcad439 rename the stream based Handle write APIs 2019-10-15 00:40:15 +05:30
Harendra Kumar
6225379eb6 Hide the "array stream" Handle IO APIs
These can possibly be expressed in terms of the generic polymorphic IO APIs
once we have those. For now we can use these from the Internal module.
2019-10-15 00:40:15 +05:30
Harendra Kumar
6f517f7ae5 Consolidate FileSystem.Handle with Internal.FileSystem.Handle 2019-10-15 00:40:15 +05:30
Harendra Kumar
58d1d61afd Use unfolds instead of streams for array reading 2019-10-15 00:40:15 +05:30
Harendra Kumar
a5b8b07630 Export some hidden internal functions 2019-10-15 00:40:15 +05:30
Harendra Kumar
e1022be150 Move Array module to Internal 2019-10-15 00:40:15 +05:30
Harendra Kumar
0dae18109d Add notes about module organization 2019-10-12 18:33:39 +05:30
Harendra Kumar
99c02e86c9 Add some notes about the need for linked-lists 2019-10-12 18:33:39 +05:30
Harendra Kumar
50aa8c1a93 rename runScan to scan
Also runPostscan to postscan.

This follows the naming of fold/unfold.
2019-09-29 15:55:47 +05:30
Harendra Kumar
16c2f015c2 rename "runFold" to "fold"
* we are using "unfold" for unfolding, runUnfold is longer and sounds a bit
  weird. So similar to "unfold" we should use "fold" for folding.
* Another reason is that "runFold" sound ends in "unfold" so can sound
  confusing.
2019-09-29 14:52:29 +05:30
Harendra Kumar
a1b976281a Move the unfold combinator to Stream prelude module 2019-09-29 12:51:01 +05:30
Harendra Kumar
4810c8eef6 Add nested unfold operations and benchmarks
Especially add chaining of unfolds and outerProduct operations. outerProduct is
just the cartesian product of two streams, it is like the concatMap/bind for
streams. In contrast to concatMap, the unfold nested looping operations are
amenable to complete fusion providing us amazing performance equivalent to
linear stream operations.
2019-09-29 01:37:22 +05:30
Harendra Kumar
db0a150df4 Enable FileSystem.File module example 2019-09-26 01:36:19 +05:30
Harendra Kumar
b8b3e17eef stop exporting ArrayStream APIs from Array module
This module is now only for convenience as all APIs can be expressed in terms
of Stream APIs with the same performance.
2019-09-26 01:36:19 +05:30
Harendra Kumar
8fbb4d4227 enable pipe/sink/list benchmarks 2019-09-26 01:05:15 +05:30
Harendra Kumar
e1ba45aeba Add a fold operation for unfolds 2019-09-25 20:03:56 +05:30
Harendra Kumar
6ae0ed003c remove Streamly.Internal module 2019-09-25 18:39:34 +05:30
Harendra Kumar
d098a0575a Move Streamly.Enumeration to Streamly.Streams.Enumeration 2019-09-25 17:17:48 +05:30
Harendra Kumar
3c8f5b8096 move Sink module files to Internal 2019-09-25 17:17:48 +05:30
Harendra Kumar
1604254925 move files Streamly/Time/* to Streamly/Internal/Data 2019-09-25 17:17:48 +05:30
Harendra Kumar
623b3fda76 move file Streamly/Strict.hs to Internal 2019-09-25 17:17:48 +05:30
Harendra Kumar
631cc24fec move file SVar.hs to Internal/Data 2019-09-25 17:17:47 +05:30
Harendra Kumar
e2baec7b1d move Atomics to Internal 2019-09-25 17:17:47 +05:30
Harendra Kumar
98393fc44a move pipe module files to Internal 2019-09-25 17:17:47 +05:30
Harendra Kumar
fa8a5fd5ad move file FileSystem/File.hs to Internal 2019-09-25 17:17:46 +05:30
Harendra Kumar
bcecc5a261 move file FileSystem/Handle/Internal.hs to Internal 2019-09-25 17:17:46 +05:30
Harendra Kumar
e62d37ed18 remove export of readU from Streamly.Internal 2019-09-25 17:17:46 +05:30
Harendra Kumar
bcf8ef41b9 rename Memory/Array/Types.hs to Internal 2019-09-25 17:17:46 +05:30
Harendra Kumar
a754b13030 rename Streamly.List to Streamly.Internal.Data.List 2019-09-25 17:17:46 +05:30
Harendra Kumar
1475c2fb7d Move Streamly.Unfold to Streamly.Internal.Data.Unfold 2019-09-24 21:28:25 +05:30
Harendra Kumar
2af9c97500 move Unfold module files to internal 2019-09-24 21:14:51 +05:30
Harendra Kumar
ae847b821f remove fold API exports from Streamly.Internal
They are now exported via Streamly.Internal.Data.Fold
2019-09-24 21:14:51 +05:30
Harendra Kumar
885a66f45a merge Streamly.Fold.Internal with Streamly.Internal.Data.Fold 2019-09-24 21:14:51 +05:30
Harendra Kumar
042b677592 Move Streamly.Fold module
* Move exposed Streamly.Fold to Streamly.Data.Fold
* Move the internal implementation to Streamly.Inetrnal.Data.Fold
2019-09-24 21:14:51 +05:30
Harendra Kumar
a8dd99dc75 move Fold modules to Internal 2019-09-24 20:55:49 +05:30
Harendra Kumar
ee6be006b2 Stop exposing internal Prelude functions via Internal
They are now exposed via Internal.Prelude
2019-09-24 20:55:41 +05:30
Harendra Kumar
6b98e076d2 Fix build with "dev" flag 2019-09-24 20:55:31 +05:30
Harendra Kumar
b051167f42 Use Internal.Prelude module in place of Internal 2019-09-24 20:55:07 +05:30
Harendra Kumar
beeed6b1c7 import Streamly.Internal.Prelude in place of Streamly.Prelude.Internal 2019-09-24 20:54:28 +05:30
Harendra Kumar
c1aa574d1e move Prelude/Internal.hs to Internal.Prelude.hs 2019-09-24 20:49:24 +05:30
Harendra Kumar
aea974c0d2 import the renamed ArrayStream module 2019-09-24 15:32:02 +05:30
Harendra Kumar
52d0bfdaa3 Move ArrayStream to Internal module 2019-09-24 15:26:43 +05:30
Harendra Kumar
b96d73517e move touch at the end of the loop 2019-09-21 01:06:09 +05:30
David Feuer
b438759fec Improve demuxing
* Use `alterF` to speed up `Map` modification.

* Bump lower bound on `containers`.

* Make `demuxWith` and `demuxWith_` just powerful enough to implement
`demux` and `demux_` without extra mapping. We could actually go
further if we wanted.
2019-09-20 23:42:07 +05:30
David Feuer
f312ccb596 Cleanup cleanup 2019-09-20 23:39:30 +05:30
Harendra Kumar
3a4f72af7e Simplify and optimize utf-8 decoding
* Simplify the state machine to carry minimal state
* reduce branches taken and improve branch prediction

With this change decode-utf8 has almost the same performance as decodeChar8 for
the ascii case. For the mixed unicode chars case as well the performance is
pretty good and not too far away from the ascii case.

Stream and array versions both fuse to similar core which pretty small and both
cases show exactly the same performance.
2019-09-20 01:46:39 +05:30
Harendra Kumar
069728c621 Use cacheline aligned lookup table
It makes a barely noticeable difference.
2019-09-19 08:59:59 +05:30
Harendra Kumar
e12c86463f make some performance improvements for utf8 decoding
1) Change the Codepoint type to Int for cheaper conversion to Char
2) Add strictness annotations in decode
3) Reorder the constructor arguments
4) Move foreign ptr touch to only once after the array is done
2019-09-19 08:59:59 +05:30