I wonder why equals Map (ifSome) .getOrElse (ifNone) What You can do this: or (Both will evaluate the solution value Edit: But what exactly do you want Scalazâ € ™ s which is equal to However, I should comment that you should use only CAT when it is more natural ???? The way to express it is like many cases where a simple scala.option has no way
fold defined as:
fold (IfSome: A => B, ifNone: = & gt; B)
map +
getOrElse ?
opt foldLeft (els) (X, y) => funny (x))
(ELS /: OPT) ((x, y) = > Fun (X))
els ), which may be What do you want To indicate this.)
cata (basically a
fold which handles not only
some values, but also does not map to
any part (Some: A => X, None: => X): X = Value Match {Case No => Any case is anything (a) => Some (A)}
opt.map (some) .getOrElse (none) .
map â getOrElse is sufficient, especially when there are many
maps (though You can sort the
fun s with the function structure, of course, it depends on whether you want to focus on the function structure or value change.)
Comments
Post a Comment