Hi Bryan,<br><br>GHC 6.10.1, Parsec 3.0.0 and type signatures are right from the code: they are actually real (except the ones with the &lt;shortcuts&gt;). I see now that it is really a better idea to use internal Parser state to collect the data I need to carry through, so in any case thank you<br>
<br>I&#39;ve sent two letters on topic not to the mail-list, so I&#39;ll quote them here:<br><br>&quot;to make the problem clear: I&#39;ve changed parseSyslog function from
Parser type to StateT Parser type (a parser with some additional user
state); the question is: how should I use &quot;parse&quot; function, which
expects Parser type signature for it&#39;s first argument? Am I right that
I should lift parse function to the StateT transformer to achieve this?&quot;<br><br>&quot;the Parser datatype from the Parsec library is itself a State monad;
however, it&#39;s internal state is used for parsing purposes. What is a
good practice to implement stateful parsers with Parsec? Using StateT
transformer on top of the Parser type, or using it&#39;s own internal
state? Or maybe there is some better way, that I am anaware of?&quot;<br><br>that&#39;s the state of things right now actually, but I think the solution is already clear. Thanks to everyone in the conversation :)<br><br>
<br><div class="gmail_quote">2009/8/3 Bryan O&#39;Sullivan <span dir="ltr">&lt;<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div class="im">On Mon, Aug 3, 2009 at 10:46 AM, Paul Sujkov <span dir="ltr">&lt;<a href="mailto:psujkov@gmail.com" target="_blank">psujkov@gmail.com</a>&gt;</span> wrote:<br><div> </div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
parseSyslog :: StateT Integer Parser TimeStamp<br>parseString :: StateT Integer Parser LogString<br><br>and the following code:<br></div>
parseString = do [...]<br></blockquote><div><br>Without real code to look at, it&#39;s impossible to properly debug the errors in your pseudocode above. For instance, your type signatures aren&#39;t real, and you don&#39;t mention which version of Parsec you&#39;re using.<br>

<br>Regardless, you shouldn&#39;t need to use monad transformers with Parsec, as it has its own support for managing state that gives you exactly the same features as StateT. See the getState, setState, and updateState functions. I notice that you try to explain why you are using StateT later in your message, but I don&#39;t understand your description.<br>

</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Regards, Paul Sujkov<br>