Okay...I think I am beginning to understand.
Is it right to assume that "magic" is backed by FFI and cannot be done in "pure" Haskell?
C K Kashyap <ckkashyap@gmail.com> writes:At it's heart, monads are "just" syntactic convenience, but like many
> I looked at State Monad yesterday and this question popped into my mind.
> From what I gather State Monad essentially allows the use of Haskell's do
> notation to "invisibly" pass around a state. So, does the use of Monadic
> style fetch us more than syntactic convenience?
other syntactic conveniences, allows you to structure your code better.
Thus it's more about programmer efficiency than program efficiency.
(The "do notation" is syntactic sugar for >>= and >>).
STArray and IOArrays are "magic", and uses monads to ensure a sequence
> Again, if I understand correctly, in Mutable Arrays also, is anything
> getting modified in place really? If not, what is the real reason for better
> efficiency?
of execution to allow (and implement) in-place modification. So this
gives you better performance in many cases. Don't expect this from
generic monads.
-k
--
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe