title: Set counter in haskell and increment it
body: <pre><code>digits :: Int-&gt;Int-&gt;Int
  digits x y
       |x`mod`10 == y`mod`10 = count x y 
       |otherwise = digits (x`div`10) (y`div`10)
  
  count :: Int -&gt; Int -&gt; Int
  k = 0 + 1
  count x y 
      |x &lt; 1 = getprize k
      |otherwise = digits (x`div`10) (y`div`10) 
  
  getprize :: Int -&gt; Int
  getprize k
        |k == 8 = 1000000
        |k == 7 = 100000
        |k == 6 = 8000
        |k == 5 = 300       
        |k == 4 = 20
        |k == 3 = 5
        |k == 2 = 1
        |k &lt; 2 = k
        |otherwise = 43 
  </code></pre>
  
  <p>So I wrote this code in Haskell and the goal is to search how many digits in the input numbers x, y are equal and when I try to set a counter (in my code k) I can't call getprize with k cause it is registered as an integer how can I set the counter to be int so I can count how many digits are the same?</p>