perform an operation on a data stream and compile the result