This GHC plugin performs Data Flow Fusion as described in the following paper:
Data Flow Fusion with Series Expressions in Haskell Ben Lippmeier, Manuel Chakravarty, Gabriele Keller, Amos Robinson. Haskell Sympoium, 2013.
The user-facing API is defined by the repa-series package.
To run the transform on a program do something like:
ghc -O2 -fplugin=Data.Array.Repa.Plugin --make Main.hs
To see intermediate code as it is transformed, pass the
dump flag to the plugin.
ghc -O2 -fplugin=Data.Array.Repa.Plugin -fplugin-opt Data.Array.Repa.Plugin:dump --make Main.hs
There is example code at: http://code.ouroborus.net/repa/repa-head/repa-plugin/test/
This is an EXPERIMENTAL implementation that some CURRENT LIMITATIONS:
- Only supports Series of element types
Int). You can't yet fuse code using the
Floattype, or anything else.
- You can't use case-expressions in the worker functions passed
to combinators like
- The plugin lacks support for many common list functions,
- If your code cannot be fused then you may get an unhelpful error message.