<div dir="ltr">I&#39;m working on a project in which I am attempting to write a parser for Haskell within Haskell itself using Parsec. <div><br></div><div style>The parser itself only deals with a subset of the features of the full Haskell implementation but I&#39;m having difficulty figuring out how to implement the grammar with precedence of operations for example boolean expression involving &amp;&amp; over || and also &#39;if then else&quot; statements in relation to other operations. </div>
<div style><br></div><div style>I&#39;m attempting to do this with the Text.Parsec.Expr module more specifically BuildExpressionParser combinator using table and term as used in a number of tutorials I have seen which deal with arithmetic expression. Is this the correct course of action? Or will it fail to meet my needs.</div>
<div style><br></div><div style>Will it be necessary to create an AST for the grammar by creating new data types as outlined in the following tutorial? </div><div style><a href="http://www.haskell.org/haskellwiki/Parsing_a_simple_imperative_language">http://www.haskell.org/haskellwiki/Parsing_a_simple_imperative_language</a><br>
</div><div style><br></div><div style>Also what&#39;s the difference between the modules:</div><div style>Text.Parsec.Expr</div><div style>Text.ParserCombinators.Parsec.Expr</div><div style><br></div><div style>Thanks in advance,<br>
</div><div style>Seán</div></div>