title: Structual induction in Haskell
body: <p>Can anyone give me an example of Structural induction in Haskell? I can't find nothing online about it, I have been given a hypothesis but having trouble formulating the base case.</p>
  
  <p>The hypothesis is:
  For all lists <code>xs</code> of type <code>[a]</code> and all <code>x</code> of type <code>a</code> it is:</p>
  
  <pre><code>toLast (x:xs) = xs |++| [x]
  </code></pre>
  
  <p>With <code>|++|</code> being my own version of concatenating two lists and <code>toLast</code> being a function where the header of a list goes to the end of the list. I have tried to figure this out myself and got <code>toLast [] = [] |++| []</code> but I am unsure if this is correct.</p>