title: Function which outputs a list of factors
body: <p>For an assignment I need to create a function which takes a list of <code>Int</code>s and outputs all of a number's factors in a new list. Thing is, I have absolutely no idea how to do this. I know its signature needs to be like this though :</p>
  
  <pre><code>factors :: [Int] -&gt; [[Int]]
  factors xs = ???
  </code></pre>
  
  <p>So when you take a list like this : <code>[2,5,7,8]</code></p>
  
  <p>It outputs <code>[[],[],[],[2,4]]</code></p>
  
  <p>I have tried things with map, filter, mod, list comprehension or higher order functions, but since this is the first language I am learning, it's very hard for me to come up with any sort of solution.</p>