<div class="gmail_quote">On Tue, Apr 14, 2009 at 9:24 AM, Cristiano Paris <span dir="ltr"><<a href="mailto:frodo@theshire.org">frodo@theshire.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Tue, Apr 14, 2009 at 5:09 PM, Luke Palmer <<a href="mailto:lrpalmer@gmail.com">lrpalmer@gmail.com</a>> wrote:<br>
> ...<br>
<div class="im">> Please don't say that. He's a beginner.<br>
> You realize that the path of least resistance will be to use it, right?<br>
> You see why that's not a good thing?<br>
> Even experts don't use this function.<br>
> (To the O.P.: don't use it)<br>
<br>
</div>Mmmh, sorry Luke but I don't understand this ostracism.<br>
<br>
unsafePerformIO is not "evil" by itself, it's there for a purpose and,<br>
as for anything else in the language, it's better to understand when<br>
to use it and when not rather than just knowing that is something that<br>
MUST not be used, without any further explanation.</blockquote><div><br></div><div>You have a point. I would like to avoid introducing unfounded authoritarian stigmas whenever possible.</div><div><br></div><div>However, the way I see it is that unsafePerformIO *is* evil by itself, and it is only by the addition of Holy Water that it is benign to use. </div>
<div><br></div><div>Ryan Ingram described it as a way to achieve "RTS extensions", which I think is a fine way to put it I consider Debug.Trace to be an instance of this: we are extending the RTS to provide execution traces.</div>
<div><br></div><div>I guess it's a teaching style thing. Mostly, if someone sees "I have an IO [XmlTree] and I need an [XmlTree]", I want the "I'm asking the wrong question" synapse path to fire, rather than the "just use unsafePerformIO" one.</div>
<div><br></div><div>Luke</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
More, from my personal experience, knowing unsafePerformIO helped me<br>
understand better what Monads are and how they should be used.<br>
<br>
I wounder what so-called "experts" have to say about this.<br>
<font color="#888888"><br>
Cristiano<br>
</font></blockquote></div><br>