title: Haskell - Finding Divisors of an Integer
body: <p>According to the book this is how its done, but I am not able to get this to work. It gives me an error Not in scope: 'ld'. I'm guessing I should be importing some package but not sure which one. Also the book uses GS module at the prompt but I'm using WinGHCi that has Prelude. What am I missing here?</p>
  
  <pre><code>factors :: Int -&gt; [Int]
  factors n | n &lt; 1 = error "not positive"
            | n == 1 = []
            | otherwise = p : factors (div n p)
                          where p = ld n
  </code></pre>
  
  <p>I guess this can also be done using map and filter functions? How?</p>