Efficient Monadic Streams
Conference contribution, 2015

Functional stream representations allow for a high-level, compositional way of programming digital signal processing algorithms. However, some algorithms, such as filters, cannot be efficiently implemented using purely functional techniques, due to excessive copying of data. We present a monadic representation of streams which introduces the ability to use mutation for efficiency when implementing algorithms. Still, our representation enjoys many of the benefits of purely functional streams, such as a functional API and fusion. Our representation enables further optimizations: we show how to remove duplicate loop variables, and how to keep buffers entirely in references. Our measurements show that the new monadic representation consistently outperforms the functional representation by at least a factor of four when evaluated in the context of the Feldspar embedded DSL.

Author

Josef Svenningsson

Chalmers, Computer Science and Engineering (Chalmers), Software Technology (Chalmers)

Emil Axelsson

Chalmers, Computer Science and Engineering (Chalmers), Software Technology (Chalmers)

Anders Persson

Chalmers, Computer Science and Engineering (Chalmers), Software Technology (Chalmers)

Peter A. Jonsson

Trends in Functional Programming

Areas of Advance

Information and Communication Technology

Subject Categories

Computer and Information Science

More information

Created

10/8/2017