title: haskell reverse polish notation
body: <p>being new to haskell I decied to try and implement a mini reverse polish notation function:</p>
  
  <p>Takes in a <code>list</code> of type <code>int</code> and a string operator (<code>'*','+','/','-'</code>) </p>
  
  <p>apply the operator to the <code>tail</code> element and the <code>tail-1</code> element</p>
  
  <p>return the resultant <code>list</code> with the two elements involved in the operation popped off and the resultant element appended to the tail as such:</p>
  
  <pre><code>Where e0 = original element at index 0
  
  r = result of the operation:
  
  result = [e0,e1,e2...r] (elements popped off: eN, eN-1)
  </code></pre>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>import Data.List
  import System.IO
  
  step :: [Int] -&gt; String -&gt; [Int]
  step stack operator
      | (x:y:ys) "*" = (x * y):ys
      | (x:y:ys) "+" = (x + y):ys
      | (x:y:ys) "-" = (x - y):ys
      | (x:y:ys) "/" = (x / y):ys
  </code></pre>
  
  <p>And it gives me the following compile error:</p>
  
  <pre><code>• Couldn't match expected type ‘[Char] -&gt; Bool’
                    with actual type ‘[a3]’
      • The function ‘x : y : ys’ is applied to one argument,
        but its type ‘[a3]’ has none
        In the expression: (x : y : ys) "/"
        In a stmt of a pattern guard for
                       an equation for ‘step’:
          (x : y : ys) "/"
  </code></pre>
  
  <p>I believe this is the result of an error in my syntax,
  any help is welcome!</p>