Safe Haskell | None |
---|
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.
http://www.cse.unsw.edu.au/~benl/papers/flow/flow-Haskell2013.pdf
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
and (Int
,Int
). You can't yet fuse code using theFloat
type, or anything else. - You can't use case-expressions in the worker functions passed
to combinators like
map
andfold
. - The plugin lacks support for many common list functions,
such as
append
. - If your code cannot be fused then you may get an unhelpful error message.