title: Using the Maybe Monad in "reverse"
body: <p>Let's say I have a number of functions:</p>
  
  <pre><code>f :: a -&gt; Maybe a
  g :: a -&gt; Maybe a
  h :: a -&gt; Maybe a
  </code></pre>
  
  <p>And I want to compose them in the following way: If f returns Nothing, compute g. If g returns Nothing, compute h. If any of them compute Just a, stop the chain. And the whole composition (h . g . f) should of course return Maybe a.</p>
  
  <p>This is the reverse of the typical use of the Maybe monad, where typically you stop computing if Nothing is returned.</p>
  
  <p>What's the Haskell idiom for chaining computations like this?</p>