I have a Boolean and would like to avoid this pattern:
if (myBool) Option(someResult) else None
What I\'d like to do is
Here are a couple things I would consider:
val bool: Boolean = ??? val result = 1337 Option(bool).withFilter(identity).map(_ => result)
or
for { opt <- Option(bool) if opt } yield result