title: Megaparsec: Unable to parse recursive arithmetic string
body: <p>I'm working on a small parser using Megaparsec and trying to parse arithmetic.</p>
  
  <pre><code>-- Arithmetic expressions
  data Aexp = N Num 
              | V Var 
              | Mult Aexp Aexp
              | Add Aexp Aexp 
              | Sub Aexp Aexp 
               deriving (Show, Eq, Read)
  
  
  arithParser :: Parser Aexp
  arithParser = V &lt;$&gt; strParser
              &lt;|&gt; N &lt;$&gt; numParser
              &lt;|&gt; Mult &lt;$&gt; arithParser &lt;* tok "*" &lt;*&gt; arithParser
  --boolParser :: Parser Bexp
  
  
  strParser :: Parser Var
  strParser = tok "\"" *&gt; some (noneOf ("\n\r\"=[]{},:")) &lt;* tok "\""
  
  numParser :: Parser Num
  numParser = (some (oneOf ['0' .. '9']) &gt;&gt;= return . read) &lt;* whitespace
  </code></pre>
  
  <p>If I run the command <code>Parse arithParser "5*5" "5*5"</code> it just returns <code>Right (N 5)</code>, where it should return <code>Mult(N 5) (N 5)</code>. Because of the precedence in the arithParser. But if I change the order then it seems to go into an infinite loop and crash.</p>
  
  <p>Not sure what I'm doing wrong here, any help would be appreciated.</p>