OptionOps2
final
class Object
trait Matchable
class Any
Type members
Value members
Concrete methods
final
Ternary operator. Note that the arguments s and n are call-by-name.
Ternary operator. Note that the arguments s and n are call-by-name.
Example
option ? "defined" | "undefined"
Returns the provided function s
applied to item contained in the Option if it is defined,
otherwise, the provided value n
.
Returns the provided function s
applied to item contained in the Option if it is defined,
otherwise, the provided value n
.
This is a syntactic alternative to scalaz.syntax.std.OptionOps#cata
Example:
o.some(_ * 2).none(0)