title: non-pure constant which increases by 1 for each evaluation
body: <p>I'm very new to Haskell and trying to understand the basics of functional programming. I need to create a non-pure constant <code>next_nat :: Integer</code> which on first evaluation results in <code>0</code> and then increases by <code>1</code> for each evaluation. I then also need to call this as a parameter on a pure function <code>f</code> like <code>f next_nat</code> and check the result depending on argument evaluation.</p>
  
  <p>I'm not sure how to do this. How can I increase it for each evaluation? Do I need other variables for this task? I only came up with this at the moment:</p>
  
  <pre><code>next_nat :: Integer
  next_nat = 0
  
  f :: Integer -&gt; Integer
  f x = x+1
  </code></pre>
  
  <p>I don't think this is right in this way..</p>