I was thinking the same thing. If I remember correctly, RWH does a parser in an applicative style, but I&#39;ll have to look when I get home to be sure. If so, then maybe we could try doing the same thing in a monadic style, for comparison and contrast purposes.<br>
<br><div class="gmail_quote">On Thu, Mar 12, 2009 at 11:29 AM, Jeff Heard <span dir="ltr">&lt;<a href="mailto:jefferson.r.heard@gmail.com">jefferson.r.heard@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;">
Come to think of it, I&#39;ve never seen an applicative tutorial of<br>
Parsec, only a monadic one.  Does such a beast exist, and if so, maybe<br>
we could merge the two together, work the same example in both, and<br>
thus help the programmer make the shift from monadic to applicative,<br>
from order of parsing to describing the grammar.<br>
<br>
-- Jeff<br>
<br>
2009/3/12 Conal Elliott &lt;<a href="mailto:conal@conal.net">conal@conal.net</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Thank you Bob!  I&#39;ll throw in another 2 cents:<br>
&gt;<br>
&gt; Yes, *one* aspect of Haskell is that it&#39;s a power tool for imperative<br>
&gt; programming -- a clever way to keep plugging away at the old sequential von<br>
&gt; Neumann paradigm.  C++++.<br>
&gt;<br>
&gt; I&#39;d rather we strongly encourage Haskell-newbies toward shifting out of the<br>
&gt; imperative paradigm to thinking and programming *functionally*.  It&#39;s a big<br>
&gt; shift, to make, and imperative-Haskell is a relatively easy substitute.<br>
&gt;<br>
&gt;    - Conal<br>
&gt;<br>
&gt; On Thu, Mar 12, 2009 at 7:28 AM, Thomas Davie &lt;<a href="mailto:tom.davie@gmail.com">tom.davie@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 12 Mar 2009, at 15:16, Andrew Wagner wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Can you expand on this a bit? I&#39;m curious why you think this.<br>
&gt;&gt;<br>
&gt;&gt; For two reasons:<br>
&gt;&gt;<br>
&gt;&gt; Firstly, I often find that people use the Monadic interface when one of<br>
&gt;&gt; the less powerful ones is both powerful enough and more convenient, parsec<br>
&gt;&gt; is a wonderful example of this.  When the applicative instance is used<br>
&gt;&gt; instead of the monadic one, programs rapidly become more readable, because<br>
&gt;&gt; they stop describing the order in which things should be parsed, and start<br>
&gt;&gt; describing the grammar of the language being parsed instead.<br>
&gt;&gt;<br>
&gt;&gt; Secondly, It seems relatively common now for beginners to be told about<br>
&gt;&gt; the IO monad, and start writing imperative code in it, and thinking that<br>
&gt;&gt; this is what Haskell programming is.  I have no problem with people writing<br>
&gt;&gt; imperative code in Haskell, it&#39;s an excellent imperative language.  However,<br>
&gt;&gt; beginners seeing this, and picking it up is usually counter productive –<br>
&gt;&gt; they never learn how to write things in a functional way, and miss out on<br>
&gt;&gt; most of the benefits of doing so.<br>
&gt;&gt;<br>
&gt;&gt; Hope that clarifies what I meant :)<br>
&gt;&gt;<br>
&gt;&gt; Bob_______________________________________________<br>
&gt;&gt; Haskell-Cafe mailing list<br>
&gt;&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>