title: Haskell, doing some code followed by an if statement in one function
body: <p>I've been using haskell for roughly a week now and I don't seem to understand how to add a line of code above an if statement that will be executed each time the function is called. Below is the code I've put together for the purpose of this question:</p>
  
  <pre><code>let example x = 
      if (x == 1) then "Number is 1" 
      else if (even x) then example (x - 1) 
      else example (x - 2) 
  </code></pre>
  
  <p>What I want to happen is for the number to be printed each time the function is called, so logic was telling me to find out how to add a line above the if statement to print [x]. I've looked into it heavily but haven't been able to find a solution. I looked into the "Do" but I couldn't seem to get it working. If anyone can shine some light on this area it would be much appreciated. </p>