<div dir="ltr"><div>See also <a href="http://book.realworldhaskell.org/read/io.html">http://book.realworldhaskell.org/read/io.html</a></div><div><br></div><div>Example (take stdin and stdout the uppercased)<br></div><div>
<pre id="gmail-toupper-lazy4.hs:all" class="gmail-programlisting">import Data.Char(toUpper)
main = interact (map toUpper)</pre>
<br></div></div><br><div class="gmail_quote"><div dir="ltr">Le ven. 6 juil. 2018 à 09:33, Olivier Revollat <<a href="mailto:revollat@gmail.com">revollat@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>Maybe you should try "interact" <br></div><div><br></div><div>
<pre class="m_-9058222695464750085gmail-de1">main <span class="m_-9058222695464750085gmail-sy0">=</span> io <span class="m_-9058222695464750085gmail-br0">(</span><span class="m_-9058222695464750085gmail-kw3">map</span> processIt<span class="m_-9058222695464750085gmail-br0">)</span>
io f <span class="m_-9058222695464750085gmail-sy0">=</span> <span class="m_-9058222695464750085gmail-kw3">interact</span> <span class="m_-9058222695464750085gmail-br0">(</span><span class="m_-9058222695464750085gmail-kw3">unlines</span> . f . <span class="m_-9058222695464750085gmail-kw3">lines</span><span class="m_-9058222695464750085gmail-br0">)<br><br></span></pre>
<br></div></div><br><div class="gmail_quote"><div dir="ltr">Le jeu. 5 juil. 2018 à 22:21, Awsaf Rahman <<a href="mailto:awsafrahman1704@gmail.com" target="_blank">awsafrahman1704@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello everyone! <div><br></div><div>I am really struggling with Haskell I/O. </div><div><br></div><div>I have written a mergesort program and as an input to that program I want to use a file containing a list of 1000 integers. Let's say the contents of the file look like this</div><div><br></div><div>[120, 400, 500 , 20, 100 ..] </div><div><br></div><div>How can I achieve that? I am trying to write a main function that takes the file as an input and passes the list to my mergesort function.. </div><div><br></div><div>Regards</div><div>Awsaf Rahman</div></div>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>
</blockquote></div>