title: Implementing tail recursion
body: <p>I've written a simple function in haskell that is non tail recursive that sums up the values inside a list where:</p>
  
  <pre><code>nonTailRecursiveSum :: [Integer] -&gt; Integer
  nonTailRecursiveSum [] = 0 --base case
  nonTailRecursiveSum (x:xs) = x + sum xs
  </code></pre>
  
  <p>But what I'm trying to do now is to implement the same function but using tail recursion. For what i know, tail recursion performs the recursive call at the final step so i tried something like:</p>
  
  <pre><code>tailRecursiveSum :: [Integer] -&gt; Integer
  tailRecursiveSum [] = 0
  tailRecursiveSum (x:xs) = aux_f(x) + tailRecursiveSum xs
  .
  .
  </code></pre>
  
  <p>But i got lost in the midway as I'm not familiar with tail recursion in Haskell. Could anyone assist me on the continuation of the tail recursive version of the code?</p>