title: Filter a list by pattern matching
body: <p>How can I filter a list, keeping the items that match a pattern, removing ones that don't?</p>
  
  <p>For example, if I have a list of lists, I would like a function...</p>
  
  <pre><code>singleItemLists :: [[Int]] -&gt; [[Int]]
  </code></pre>
  
  <p>... to remove all items that don't match the pattern <code>[x]</code>.</p>
  
  <p>Ideally, answers should be fairly straightforward to convert to other patterns.</p>