title: Scala: Boolean to Option
body: <p>I have a Boolean and would like to avoid this pattern:</p>
  
  <pre><code>if (myBool) 
    Option(someResult) 
  else 
    None
  </code></pre>
  
  <p>What I'd like to do is </p>
  
  <pre><code>myBool.toOption(someResult)
  </code></pre>
  
  <p>Any suggestions with a code example would be much appreciated.</p>