I tend to use Control.Monad.Reader for stateful stuff like this. It is found in the mtl package<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://hackage.haskell.org/package/mtl-2.0.1.0">http://hackage.haskell.org/package/mtl-2.0.1.0</a><br>
<br><div class="gmail_quote">On Wed, Jun 29, 2011 at 7:40 AM, ARJANEN Loïc Jean-David <span dir="ltr">&lt;<a href="mailto:arjanen.loic@gmail.com">arjanen.loic@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
For a pet project I need a global counter, giving how many times a<br>
given function was called. What would you use for that purpose ?<br>
<br>
Loic<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Michael Xavier<br><a href="http://www.michaelxavier.net">http://www.michaelxavier.net</a><br>
</div>