title: Recursive function that returns all values in list (In OCaml)
body: <p>I need a function that recursively returns (not prints) all values in a list with each iteration. However, every time I try programming this my function returns a list instead.</p>
  
  <pre><code>let rec elements list = match list with
   | [] -&gt; []
   | h::t -&gt; h; elements t;;
  </code></pre>
  
  <p>I need to use each element each time it is returned in another function that I wrote, so I need these elements one at a time, but I can't figure this part out. Any help would be appreciated.</p>