<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<BR>

<P><FONT SIZE=2>Hi, I'm just started to learn Haskell. Coming from a programming contest<BR>
background (where it is important to be able to solve problems in a small<BR>
amount of code) I'm wondering what the best way is for simple IO.<BR>
<BR>
A typical input file (in a programming contest) is just a bunch of numbers<BR>
which you want to read one by one (sometimes interspersed with strings). In<BR>
C/C++ this is easily done with either scanf or cin which reads data<BR>
separated by spaces. In Haskell I have not found an equally satisfactionary<BR>
method. The methods I know of<BR>
<BR>
1) Stay in the IO monad and write your own readInt readString functions. A lot<BR>
of code for something easy.<BR>
<BR>
2) Use interact together with words and put the list of lexemes in a State<BR>
monad and define getInt where at least you can use read.<BR>
<BR>
3) Use ByteString.Char8 which has readInt (but I couldn't find a<BR>
readString). But one has to put it also in a State monad.<BR>
<BR>
I think that there must be standard function that can do this. What do<BR>
experienced Haskellers use?<BR>
<BR>
Thanks in advance<BR>
</FONT>
</P>

</BODY>
</HTML>