title: How can you access the last element in a list in ocaml
body: <p>I know that when using ocaml pattern matching it is possible to use <code>h::t</code>
  When using this the h with refer to the first element in a list and the t will refer to the rest of the list. Is it possible to use this same type of matching to get the last element in a list. So the t will refer to the last element and the h will refer to the rest of the list.</p>
  
  <p>An example of code that this would be useful for is </p>
  
  <pre><code>let rec remove x y = match y with
    [] -&gt; x
  | h::t -&gt; remove (remove_element x (get_last y)) h
  ;;
  </code></pre>