Okay...I think I am beginning to understand.<br>Is it right to assume that "magic" is backed by FFI and cannot be done in "pure" Haskell?<br><br><div class="gmail_quote">On Mon, Jul 19, 2010 at 1:47 PM, Ketil Malde <span dir="ltr"><<a href="mailto:ketil@malde.org">ketil@malde.org</a>></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 <<a href="mailto:ckkashyap@gmail.com">ckkashyap@gmail.com</a>> writes:<br>
<br>
> I looked at State Monad yesterday and this question popped into my mind.<br>
> From what I gather State Monad essentially allows the use of Haskell's do<br>
> notation to "invisibly" pass around a state. So, does the use of Monadic<br>
> style fetch us more than syntactic convenience?<br>
<br>
</div>At it's heart, monads are "just" syntactic convenience, but like many<br>
other syntactic conveniences, allows you to structure your code better.<br>
Thus it's more about programmer efficiency than program efficiency.<br>
(The "do notation" is syntactic sugar for >>= and >>).<br>
<div class="im"><br>
> Again, if I understand correctly, in Mutable Arrays also, is anything<br>
> getting modified in place really? If not, what is the real reason for better<br>
> efficiency?<br>
<br>
</div>STArray and IOArrays are "magic", 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't expect this from<br>
generic monads.<br>
<br>
-k<br>
<font color="#888888">--<br>
If I haven'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>