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

c# - Reactive Extensions ControlScheduler -

c# - Updated Castle to 3.2.1 from 3.0.0 now I cant use FirstNonGenericCoreInterface -

ios - How to determine if NSLayoutConstraint is horizontal or vertical? -