title: F#: Passing a function to Option.bind
body: <p>I have a function <code>great</code> and it is implemented as below</p>
  
  <pre><code>let great y z = Option.bind (cons (Option.get z) &gt;&gt; Some) y
  </code></pre>
  
  <p>And I have the function apply as below</p>
  
  <pre><code>let apply f val = 
    match f with
    | None -&gt; None
    | Some v -&gt; Option.map v val 
  </code></pre>
  
  <p>If I give the <code>None</code> value for the second parameter (<code>z</code>) it is giving me an error since Option.get z returns an error when it gets <code>None</code>.</p>
  
  <p>I want to avoid this error without using if else blocks. I wonder is it possible to pass the <code>great</code> function to apply so that it can evaluate <code>None</code> when the given <code>z</code> parameter is <code>None</code>.</p>
  
  <p>Any help would be appreciated.</p>