GHC certain *could* do this, but it&#39;s arguably not the right thing to do.&nbsp; For performance, the operating system buffers writes until it is ready to write large chunks at a time.&nbsp; If you do not want this behavior, change the buffering mode from its default.<br>
<br>- Phil<br><br><div class="gmail_quote">On Feb 8, 2008 5:07 PM, Jonathan Cast &lt;<a href="mailto:jonathanccast@fastmail.fm">jonathanccast@fastmail.fm</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">On 8 Feb 2008, at 4:50 PM, Brandon S. Allbery KF8NH wrote:<br><br>&gt;<br>&gt; On Feb 8, 2008, at 19:41 , Philip Weaver wrote:<br>&gt;<br>&gt;&gt; Your &quot;gsi&gt; &quot; is buffered because there&#39;s no newline at the end.<br>
&gt;&gt; To flush the buffer and force it to be printed immediately, use<br>&gt;&gt; &#39;hFlush&#39; from the System.IO library, or use &#39;hSetBuffering&#39; from<br>&gt;&gt; that same library: <a href="http://haskell.org/ghc/docs/latest/html/" target="_blank">http://haskell.org/ghc/docs/latest/html/</a><br>
&gt;&gt; libraries/base/System-IO.html<br>&gt;&gt;<br>&gt;&gt; I believe you can observe the same behavior in C.<br>&gt;<br>&gt; Most C stdio libraries in my experience have extra code in the<br>&gt; functions that read stdin to flush stdout first, specifically<br>
&gt; because of lazy people who don&#39;t pay attention to buffering.<br><br></div>Why can&#39;t GHC implement the same thing?<br><br>jcc<br><div><div></div><div class="Wj3C7c"><br>_______________________________________________<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>