lazy evaluation - Lazily coalesce Options in Scala -


In reducing my priority, there are several ways to calculate the value.

  firstWay () second () + route () or A (third y ())  

each of these has a option Gives. I want to "unite" them and get a option , which is the first some or none if all returned back None .

Of course, if preva () returns a something , then I should not count the rest.

What is the most idiotic (or at least reasonably readable) way to do this?

  Prior (). Or Else (sec () + route ()). The logic of algebra (ya (third y ()))  

or else has been evaluated.

See.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -