Conal,<br><br>It&#39;s true that you can avoid using IO (except for a wrapper) for certain kinds of programs.<br>For instance, if all you want is a String-&gt;String function, or some GUI program (you forgot to mention fudgets, which was the first wrapper of this kind) then you can ignore IO and just use a nice wrapper.
<br><br>But if someone asks me how to traverse a directory tree, invoking the &#39;file&#39; program for each &#39;,o&#39; file and then renaming it if it&#39;s a text file, then what should I answer?&nbsp; &quot;Sorry, you can&#39;t do that in Haskell.&quot;&nbsp; or &quot;You need to use the IO monad.&quot;?
<br>I prefer the latter answer, and I think people who learn Haskell need to learn something about how you do some of the things that are easy in other languages.<br><br>It&#39;s also important to teach people to stay away from IO whenever possible, but it&#39;s simply not always possible.
<br><br>&nbsp; -- Lennart<br><br><div class="gmail_quote">On Dec 9, 2007 5:31 PM, Conal Elliott &lt;<a href="mailto:conal@conal.net">conal@conal.net</a>&gt; 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="Ih2E3d">&gt; IO is important because you can&#39;t write any real program without using it.<br><br></div>Ouch!&nbsp; I get awfully discouraged when I read statements like this one.&nbsp; The more people who believe it, the more true it becomes.&nbsp; If you want to do functional programming, instead of imperative programming in a functional language, you can.&nbsp; For instance, write real, interactive programs in FRP, phooey, or TV.&nbsp; And if you do, you&#39;ll get semantic simplicity, powerful &amp; simpler reasoning, safety and composability.
<br><font color="#888888"><br>&nbsp; - Conal<br><br></font><div class="gmail_quote"><div class="Ih2E3d">On Dec 8, 2007 1:26 AM, Lennart Augustsson &lt;<a href="mailto:lennart@augustsson.net" target="_blank">lennart@augustsson.net
</a>&gt; wrote:<br></div><div><div></div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I agree with Dan here.<br><br>IO is important because you can&#39;t write any real program without using it.<br>So why not teach enough of it to get people off the ground straight away?<br><br>People who hang around long enough to do some more Haskell programming
<br>will run into the other monads sooner or later.&nbsp; But IO is an unavoidable step to<br>writing Haskell programs.<div><div></div><div><br><font color="#888888"><br><br></font><br><div class="gmail_quote">
On Dec 4, 2007 5:11 AM, Dan Piponi &lt;
<a href="mailto:dpiponi@gmail.com" target="_blank">dpiponi@gmail.com</a>&gt; 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>

On Dec 3, 2007 6:36 PM, Ben Franksen &lt;
<a href="mailto:ben.franksen@online.de" target="_blank">ben.franksen@online.de</a>&gt; wrote:<br>&gt; then the special features of IO<br>&gt; will remain associated with monads in general, leading to a whole jumble of<br>

&gt; completely wrong ideas about them.
<br><br></div>As I only learnt about monads a couple of years ago, the process is<br>still fresh in my mind. I wasted quite a bit of time labouring under<br>the impression that monads were primarily about sequencing. But that
<br>wasn&#39;t because I incorrectly generalised from IO. It was because<br>countless people out there explicitly said they were about sequencing.<br>I suspect that if courses started with the List monad there&#39;d be<br>


countless blogs telling people that monads are a way to eliminate<br>loops from your code like the way list comprehensions are used in<br>Python.<br><div><br>&gt; This is yet another problem with IO as the standard example for monads: its
<br>&gt; effect base is huge and poorly structured.<br><br></div>You don&#39;t teach *all* of IO to students in one go!<br><div><br>&gt; This again makes it difficult to<br>&gt; see exactly which intuitions about IO can be generalized to arbitrary
<br>&gt; monads and which not.<br><br></div>That&#39;s true of any monad. IO is unique. [] is unique. Cont is unique.<br>All of them can lead you down the garden path. You need to see<br>multiple monads, and it helps if you can sneak an example under a
<br>student&#39;s nose so they can already reason about monads before they<br>even know what a monad is.<br><div><br>&gt; What is pointless about failure and how to handle it?<br><br></div>It&#39;s pointless when you&#39;re still trying to make your first tweaks to
<br>&quot;Hello, World!&quot; work.<br>--<br><font color="#888888">Dan<br></font><div><div></div><div>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank">


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>
</div></div><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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><br></blockquote></div></div></div><br>
</blockquote></div><br>