<br><br><div class="gmail_quote">On Nov 5, 2007 2:41 PM, Graham Fawcett &lt;<a href="mailto:graham.fawcett@gmail.com">graham.fawcett@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 class="Ih2E3d">On Nov 5, 2007 1:46 PM, Maurí­cio &lt;<a href="mailto:briqueabraque@yahoo.com">briqueabraque@yahoo.com</a>&gt; wrote:<br>&gt; Hi,<br>&gt;<br>&gt; Is there a way to run &#39;ghc -e&#39; taking input<br>
&gt; from standard input? I would like to use it<br>&gt; in a pipe.<br><br></div>It seems to me that you can use getContents, et. al., as you would<br>from any other Haskell program:<br><br>$ echo hello there mauricio | ghc -e &quot;print =&lt;&lt; (
Control.Monad.liftM<br>(reverse . words)) getContents&quot;<br>[&quot;mauricio&quot;,&quot;there&quot;,&quot;hello&quot;]<br></blockquote><br>hm, which raises the question of exactly what Maurí­cio meant.&nbsp; Maurí­cio, if you mean you want to do ghc -e &quot;some code which gets its data from standard input&quot;, then Graham&#39;s solution is exactly what you want.&nbsp; If you mean you want to have ghc -e run some code which itself comes from standard input, then you want xargs (just do a man xargs to see how to use it).&nbsp; In retrospect I&#39;m guessing that Graham answered your real question...? =)
<br><br>-Brent</div>