instead of slicing stream, pass around index

Check out the nice error messages this enables in 0c19df243e74c366ce51c30d56531475854e2959!