A generic interface to stream fusion