scala - Exit for loop as soon as condition satisfied -


the following code hangs repl:

(   {     <- 1 1000000     j <- 2 1000000     if * == j   } yield -> j ).take(1) 

it seems expression eagerly evaluated. solutions?

i'd turn stream:

(     {         <- stream.range(1, 1000000)         j <- stream.range(2, 1000000)         if * == j     } yield -> j ).take(1) 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -