title: Filter IO [Maybe String] to IO [String]
body: <p>How to filter <code>IO [Maybe String]</code> to only keep the <code>Just</code> values of the list using <code>&gt;&gt;=</code> and keep the IO context.</p>
  
  <pre><code>-- returns Just, if the passed binary-name is not present on the system
  binDoesntExist :: String -&gt; IO (Maybe String)
  binDoesntExist ...
  </code></pre>
  
  <p>My current solution without the bind-operator:</p>
  
  <pre><code>missingBin :: [String] -&gt; IO [String]
  missingBin xs = do
    ys &lt;- mapM (\x -&gt; binDoesntExist x) xs
    return $ catMaybes ys
  </code></pre>
  
  <p>I'm currently learning Haskell and try to understand how to use the different functions of the standard library. My solution works, but I guess there is a cleaner way.</p>