title: Reversing a string (or list) recursively
body: <p>I'm trying to write a function in haskell that reverses lists recursively. I wrote a helper function that takes the original list and an empty list then transfers elements from the first one to the other in a LIFO pattern.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>myreverse :: [a] -&gt; [a]
  myreverse list = myflip list []
  
  myflip :: [a] -&gt; [a] -&gt; [a]
  myflip list1 newList
      | null list1        = newList
      | otherwise         = myflip (tail list1) ((head list1) : newList)
  </code></pre>
  
  <p>I know there's a built-in function that does it for me but the requirement is that I only use <em>head</em>, <em>tail</em>, <em>elem</em> and <em>null</em> (No pattern matching either). So my question is: is there a better solution where I only have one function, myreverse, that consumes only one list? (That meets the requirements above, of course)</p>
  
  <p>Thanks!</p>