Scala shorthand for ending a stream? -


With the practice of currents, I am searching for a normal pattern to end a stream like this:
  

stream.cons (lastValue, stream.empty)

It seems that this would be a similar pattern that is probably a short story

  stream. Finish (lastValue) // is not a real skial code   

Is such a function made in Scala?

natural options, stream (final value) does not work in general because Not applicable is not lazy, but you can use it when you do not care that you've already specified the value.

You can probably use Stream.fill (1) ()

  lastValue #: stream.empty   < P> personal.   

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -