Due to how the streaming library works I think this can be achieved by doing a `fold`, where the accumulator is the perpetual state.