Haskell function non-exaustive patters in function error : <p>I'm trying to make a function that finds the local Maximum number in a list.</p>

<pre><code>localMaxima :: [Integer] -&gt; [Integer]
localMaxima [] = []
localMaxima [x] = []
localMaxima (e1:e2:e3:xs)
    |    (e2 &gt; e3) &amp;&amp; (e2 &gt; e1) = e2 : (localMaxima (e2:(e3:xs)))
    |    otherwise = (localMaxima (e2:(e3:xs)))
</code></pre>

<p>After inputting a list of [2,3,4,1,5], the console outputs: </p>

<p>Non-exhaustive patterns in function localMaxima</p>
