repa-plugin- Data Flow Fusion GHC Plugin.

Safe HaskellNone



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:

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 the Float type, or anything else.
  • You can't use case-expressions in the worker functions passed to combinators like map and fold.
  • 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.



plugin :: PluginSource

The Data Flow Fusion plugin.