Add Stream.generate

This generates a possibly finite stream of values.

Unlike `Stream.iterate`, which passes the previously created value to the function,  `Stream.generate` passes an accumulator to the function. Hence the different name.