Javascript generators and functional reactive programming