<div dir="ltr">I have been trying to create a parser for a functional programming language, but there is no need to create an AST but merely check that the code is valid according to the grammar.<div><br></div><div style>In the following tutorial I have been trying to take some pointers from, data declarations are used to create an AST for the language, There is, as I understand a way to parse the language without an AST. </div>
<div style><br></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>
My question is what should the type signatures for example parseFile function instead of &quot;Stmt&quot; accept as input if the parser is to accept Strings and numerical expressions alike ? </div><div style><br></div><div style>
Thanks for any help,</div><div style>Seán </div></div>