title: Check whether an integer (or all elements of a list of integers) be prime
body: <p>I'm doing a simple Haskell function using recursion. At the moment, this seems to work but, if I enter <code>2</code>, it actually comes up as false, which is irritating. I don't think the code is as good as it could be, so, if you have any advice there, that'd be cool too!</p>
  
  <p>I'm pretty new to this language!</p>
  
  <p>EDIT: Ok, so I understand what a prime number is.</p>
  
  <p>For example, I want to be able to check 2, 3, 5, 7, etc and have <code>isPrime</code> return <code>true</code>. And of course if I run the function using 1, 4, 6, 8 etc then it will return <code>false</code>.</p>
  
  <p>So, my thinking is that in pseudo code I would need to do as follows:</p>
  
  <pre><code>num = 2 -&gt; return true
  num &gt; 2 &amp;&amp; num = even -&gt; return false
  </code></pre>
  
  <p>After that, I'm struggling to write it down in any working code so the code below is my work in process, but I really suck with Haskell so I'm going nowhere at the minute.</p>
  
  <pre><code>module Recursion where
  
  isPrime :: Int -&gt; Bool
  isPrime x = if x &gt; 2 then ((x `mod` (x-1)) /= 0) &amp;&amp; not (isPrime (x-1)) else False
  </code></pre>