<br><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 12:27 PM, Jonathan Cast <span dir="ltr"><<a href="mailto:jonathanccast@fastmail.fm">jonathanccast@fastmail.fm</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="Wj3C7c">On Thu, 2009-02-05 at 12:21 -0800, David Leimbach wrote:<br>
><br>
><br>
> On Thu, Feb 5, 2009 at 11:25 AM, Andrew Wagner<br>
> <<a href="mailto:wagner.andrew@gmail.com">wagner.andrew@gmail.com</a>> wrote:<br>
> I think the point of the Monad is that it<br>
> works as a container of stuff, that still<br>
> allows mathematically pure things to happen,<br>
> while possibly having some opaque "other<br>
> stuff" going on.<br>
<br>
> This at least sounds, very wrong, even if it's not. Monads<br>
> are not impure. IO is, but it's only _one_ instance of Monad.<br>
> All others, as far as I know, are pure. It's just that the<br>
> bind operation allows you to hide the stuff you don't want to<br>
> have to worry about, that should happen every time you compose<br>
> two monadic actions.<br>
<br>
<br>
> Well all I can tell you is that I can have (IO Int) in a function as a<br>
> return, and the function is not idempotent in terms of the "stuff"<br>
> inside IO being the same.<br>
<br>
</div></div>Sure it's the same.<br>
<br>
> cmp /bin/cat /bin/cat<br>
> cp /bin/cat ~<br>
> cmp /bin/cat ~/cat<br>
><br>
<br>
Pretty much the same, anyway.<br>
<br>
jcc<br>
<br></blockquote><div><br></div><div>So if IO represents a program that when executed interacts with the world's state, is it safe to say that when I return (State Int Int), that I'm returning a "State program"? That'd make sense as it really does look like we force the State to be evaluated with runState, evalState or execState.</div>
<div><br></div><div>The only difference with IO then is that to get IO programs to run, you have to do it inside another IO program.</div><div><br></div><div>I hope I'm not making this worse! :-) </div></div><br>