title: Filter on Maybe, elm
body: <p>I have a <code>List (Maybe a)</code> and i want to filter out the instances of <code>Nothing</code>. I have presumably managed to do it, but am not happy with the amount of code I needed:</p>
  
  <pre><code>removeNothingFromList : List (Maybe a) -&gt; List a 
  removeNothingFromList list =
      List.foldr
          (\cur list -&gt;
              case cur of
                  Just val -&gt;
                      val :: list
  
                  Nothing -&gt;
                      list
          )
          []
          list
  </code></pre>
  
  <p>in js the analog is accomplished simply by <code>const removeNothingFromList = (list) =&gt; list.filter(item =&gt; item)</code> and i would hope that its just my inexperience that is preventing me from seeing a comperably terse solution.</p>
  
  <p>Furthermore, is there generally a way to check for type (cast to bool), or filter on type in general?</p>