monadic icon indicating copy to clipboard operation
monadic copied to clipboard

Evaluate a "or" value lazily.

Open hiro0107 opened this issue 9 years ago • 0 comments

Sometime we want to evaluate a value of "or"'s parameter. For example, the value should be a newly created object, but if Nothing.or(...) is called, we don't want to create the object. Because the current implemented "or" method is not lazily evaluated, we have to use "if-then" statement in such a case. In scala, a parameter of the "orElse" method is evaluated lazily. This commit contains a new method "or_lazy" which evaluate the value lazily.

hiro0107 avatar Mar 10 '15 04:03 hiro0107