Okay...I think I am beginning to understand.<br>Is it right to assume that &quot;magic&quot; is backed by FFI and cannot be done in &quot;pure&quot; Haskell?<br><br><div class="gmail_quote">On Mon, Jul 19, 2010 at 1:47 PM, Ketil Malde <span dir="ltr">&lt;<a href="mailto:ketil@malde.org">ketil@malde.org</a>&gt;</span> wrote:<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="im">C K Kashyap &lt;<a href="mailto:ckkashyap@gmail.com">ckkashyap@gmail.com</a>&gt; writes:<br>

<br>
&gt; I looked at State Monad yesterday and this question popped into my mind.<br>
&gt; From what I gather State Monad essentially allows the use of Haskell&#39;s do<br>
&gt; notation to &quot;invisibly&quot; pass around a state. So, does the use of Monadic<br>
&gt; style fetch us more than syntactic convenience?<br>
<br>
</div>At it&#39;s heart, monads are &quot;just&quot; syntactic convenience, but like many<br>
other syntactic conveniences, allows you to structure your code better.<br>
Thus it&#39;s more about programmer efficiency than program efficiency.<br>
(The &quot;do notation&quot; is syntactic sugar for &gt;&gt;= and &gt;&gt;).<br>
<div class="im"><br>
&gt; Again, if I understand correctly, in Mutable Arrays also, is anything<br>
&gt; getting modified in place really? If not, what is the real reason for better<br>
&gt; efficiency?<br>
<br>
</div>STArray and IOArrays are &quot;magic&quot;, and uses monads to ensure a sequence<br>
of execution to allow (and implement) in-place modification.  So this<br>
gives you better performance in many cases.  Don&#39;t expect this from<br>
generic monads.<br>
<br>
-k<br>
<font color="#888888">--<br>
If I haven&#39;t seen further, it is by standing in the footprints of giants<br>
</font><div><div></div><div class="h5">_______________________________________________<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><br clear="all"><br>-- <br>Regards,<br>Kashyap<br>