title: Analysing the runtime efficiency of a Haskell function
body: <p>I have the following solution in Haskell to <a href="http://projecteuler.net/problem=3" rel="nofollow">Problem 3</a>:</p>
  
  <pre><code>isPrime :: Integer -&gt; Bool
  isPrime p = (divisors p) == [1, p]
  
  divisors :: Integer -&gt; [Integer]
  divisors n = [d | d &lt;- [1..n], n `mod` d == 0]
  
  main = print (head (filter isPrime (filter ((==0) . (n `mod`)) [n-1,n-2..])))
    where n = 600851475143
  </code></pre>
  
  <p>However, it takes more than the minute limit given by Project Euler. So how do I analyze the time complexity of my code to determine where I need to make changes?</p>
  
  <p><strong>Note:</strong> Please do <strong>not</strong> post alternative algorithms. I want to figure those out on my own. For now I just want to analyse the code I have and look for ways to improve it. Thanks!</p>