|
| Data.ByteString.Fusion | | Portability | portable | | Stability | experimental | | Maintainer | dons@cse.unsw.edu.au |
|
|
|
|
|
| Description |
Functional array fusion for ByteStrings.
Originally based on code from the Data Parallel Haskell project,
http://www.cse.unsw.edu.au/~chak/project/dph
|
|
| Synopsis |
|
|
|
|
| Fusion utilities
|
|
|
| :: | | | => AccEFL acc | mapping & folding, once per elem
| | -> acc | initial acc value
| | -> ByteString | input ByteString
| | -> PairS acc ByteString | | Iteration over over ByteStrings
Iteration over over ByteStrings
|
|
|
|
| :: | | | => AccEFL acc | mapping & folding, once per elem
| | -> acc | initial acc value
| | -> ByteString | input ByteString
| | -> PairS acc ByteString | |
|
|
| fuseEFL :: AccEFL acc1 -> AccEFL acc2 -> AccEFL (PairS acc1 acc2) | Source |
|
| Fuse to flat loop functions
|
|
|
| Data type for accumulators which can be ignored. The rewrite rules rely on
the fact that no bottoms of this type are ever constructed; hence, we can
assume (_ :: NoAcc) seq x = x.
| | Constructors | |
|
|
|
| Projection functions that are fusion friendly (as in, we determine when
they are inlined)
|
|
|
|
|
|
|
|
|
Special forms of loop arguments
- These are common special cases for the three function arguments of gen
and loop; we give them special names to make it easier to trigger RULES
applying in the special cases represented by these arguments. The
INLINE [1] makes sure that these functions are only inlined in the last
two simplifier phases.
- In the case where the accumulator is not needed, it is better to always
explicitly return a value `()', rather than just copy the input to the
output, as the former gives GHC better local information.
Element function expressing a mapping only
|
|
|
| Element function implementing a filter function only
|
|
|
| Element function expressing a reduction only
|
|
|
| A strict foldEFL.
|
|
|
| Element function expressing a prefix reduction only
|
|
|
| Element function implementing a map and fold
|
|
|
| Element function implementing a map with index
|
|
| Alternative Fusion stuff
|
|
| This replaces loopU with loopUp
and adds several further special cases of loops.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| sequenceLoops :: ImperativeLoop acc1 -> ImperativeLoop acc2 -> ImperativeLoop (PairS acc1 acc2) | Source |
|
|
| doUpLoop :: AccEFL acc -> acc -> ImperativeLoop acc | Source |
|
|
| doDownLoop :: AccEFL acc -> acc -> ImperativeLoop acc | Source |
|
|
| doNoAccLoop :: NoAccEFL -> noAcc -> ImperativeLoop noAcc | Source |
|
|
| doMapLoop :: MapEFL -> noAcc -> ImperativeLoop noAcc | Source |
|
|
| doFilterLoop :: FilterEFL -> noAcc -> ImperativeLoop noAcc | Source |
|
|
| These are the special fusion cases for combining each loop form perfectly.
|
|
| fuseAccAccEFL :: AccEFL acc1 -> AccEFL acc2 -> AccEFL (PairS acc1 acc2) | Source |
|
|
| fuseAccNoAccEFL :: AccEFL acc -> NoAccEFL -> AccEFL (PairS acc noAcc) | Source |
|
|
| fuseNoAccAccEFL :: NoAccEFL -> AccEFL acc -> AccEFL (PairS noAcc acc) | Source |
|
|
| fuseNoAccNoAccEFL :: NoAccEFL -> NoAccEFL -> NoAccEFL | Source |
|
|
| fuseMapAccEFL :: MapEFL -> AccEFL acc -> AccEFL (PairS noAcc acc) | Source |
|
|
| fuseAccMapEFL :: AccEFL acc -> MapEFL -> AccEFL (PairS acc noAcc) | Source |
|
|
| fuseMapNoAccEFL :: MapEFL -> NoAccEFL -> NoAccEFL | Source |
|
|
| fuseNoAccMapEFL :: NoAccEFL -> MapEFL -> NoAccEFL | Source |
|
|
| fuseMapMapEFL :: MapEFL -> MapEFL -> MapEFL | Source |
|
|
| fuseAccFilterEFL :: AccEFL acc -> FilterEFL -> AccEFL (PairS acc noAcc) | Source |
|
|
| fuseFilterAccEFL :: FilterEFL -> AccEFL acc -> AccEFL (PairS noAcc acc) | Source |
|
|
| fuseNoAccFilterEFL :: NoAccEFL -> FilterEFL -> NoAccEFL | Source |
|
|
| fuseFilterNoAccEFL :: FilterEFL -> NoAccEFL -> NoAccEFL | Source |
|
|
| fuseFilterFilterEFL :: FilterEFL -> FilterEFL -> FilterEFL | Source |
|
|
| fuseMapFilterEFL :: MapEFL -> FilterEFL -> NoAccEFL | Source |
|
|
| fuseFilterMapEFL :: FilterEFL -> MapEFL -> NoAccEFL | Source |
|
|
| Strict pairs and sums
|
|
|
| Strict pair
| | Constructors | | Instances | |
|
|
|
| Strict Maybe
| | Constructors | | Instances | |
|
|
| Produced by Haddock version 2.1.0 |